]> granicus.if.org Git - curl/commitdiff
gopher: enable the header callback/verbosity
authorDaniel Stenberg <daniel@haxx.se>
Tue, 24 Aug 2010 22:45:17 +0000 (00:45 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 25 Aug 2010 12:21:25 +0000 (14:21 +0200)
lib/gopher.c

index 6fe740f75f2fb037f0be9d6995fb2995d6637cb6..5451b2d9f3b3ebe0567fd7b92d17ded40a702299 100644 (file)
@@ -160,6 +160,11 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
   for(;;) {
     result = Curl_write(conn, sockfd, sel, k, &amount);
     if (CURLE_OK == result) { /* Which may not have written it all! */
+      result = Curl_client_write(conn, CLIENTWRITE_HEADER, sel, amount);
+      if(result) {
+        Curl_safefree(sel_org);
+        return result;
+      }
       k -= amount;
       sel += amount;
       if (k < 1)
@@ -191,6 +196,9 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
     failf(data, "Failed sending Gopher request");
     return result;
   }
+  result = Curl_client_write(conn, CLIENTWRITE_HEADER, (char *)"\r\n", 2);
+  if(result)
+    return result;
 
   Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
                       -1, NULL); /* no upload */