Ver código fonte

Changes suggested by Thomas, plus, some minor spelling istakes

HariKamath 12 anos atrás
pai
commit
59e17e4401
2 arquivos alterados com 6 adições e 5 exclusões
  1. 4 4
      include/CivetServer.h
  2. 2 1
      src/CivetServer.cpp

+ 4 - 4
include/CivetServer.h

@@ -153,10 +153,10 @@ public:
     CivetHandler *getHandler(const char *uri, unsigned urilen) const;
 	
 	/**
-	 * getCookie(const std::string &_cookieName, std::string &_cookieValue)
-	 * @param conn - the 
-	 * @param _cookieName - cookie name to h=get the value from
-	 * @param _cookieValue - cookie value is returned using thiis reference
+	 * getCookie(const std::string &cookieName, std::string &cookieValue)
+	 * @param conn - the connection information 
+	 * @param cookieName - cookie name to get the value from
+	 * @param cookieValue - cookie value is returned using thiis reference
 	 * @puts the cookie value string that matches the cookie name in the _cookieValue string.
 	 * @returns the size of the cookie value string read.
 	*/

+ 2 - 1
src/CivetServer.cpp

@@ -160,6 +160,7 @@ int CivetServer::getCookie(struct mg_connection *conn, const std::string &cookie
 	char _cookieValue[4096];
 	const char *cookie = mg_get_header(conn, "Cookie");
 	int lRead = mg_get_cookie(cookie, cookieName.c_str(), _cookieValue, sizeof(_cookieValue));
-	cookieValue = std::string(_cookieValue);
+	cookieValue.clear();
+	cookieValue.append(_cookieValue);
 	return lRead;
 }