Added socket stream and socket into SilcClientConnection context.
[silc.git] / lib / silchttp / silchttpserver.c
index 772d9c9b2b5e742a4d88bf8e3c54eb7c76a7a517..510d51b03ec3ad7621d105bec5e11322483d1255 100644 (file)
@@ -146,7 +146,7 @@ static SilcBool silc_http_server_parse(SilcHttpServer httpd,
     SILC_LOG_DEBUG(("URI: '%s'", conn->uri));
 
     /* Protocol version compatibility */
-    tmp = memchr(tmp, '\0', data_len - (tmp - data)) + 1;
+    tmp = ((unsigned char *)memchr(tmp, '\0', data_len - (tmp - data))) + 1;
     SILC_LOG_DEBUG(("Protocol: %s", tmp));
     if (strstr(tmp, "HTTP/1.0"))
       conn->keepalive = FALSE;
@@ -194,7 +194,7 @@ static SilcBool silc_http_server_parse(SilcHttpServer httpd,
 
     /* Check we have received all data */
     cl = silc_mime_get_field(conn->curheaders, "Content-Length");
-    if (cl && sscanf(cl, "%lu", (unsigned long *)&cll) == 1) {
+    if (cl && sscanf(cl, "%lu", &cll) == 1) {
       if (data_len < cll) {
        /* More data to come */
        silc_mime_free(conn->curheaders);
@@ -403,7 +403,7 @@ static void silc_http_server_io(SilcStream stream, SilcStreamStatus status,
 
 /* Accepts new connection */
 
-static void silc_http_server_new_connection(SilcNetStatus status,
+static void silc_http_server_new_connection(SilcResult status,
                                            SilcStream stream,
                                            void *context)
 {
@@ -457,6 +457,9 @@ SilcHttpServer silc_http_server_alloc(const char *ip, SilcUInt16 port,
 
   SILC_LOG_DEBUG(("Start HTTP server at %s:%d", ip, port));
 
+  if (!schedule)
+    schedule = silc_schedule_get_global();
+
   if (!ip || !schedule || !callback)
     return FALSE;