gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11592 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r11592 - gnunet/src/transport
Date: Tue, 1 Jun 2010 16:14:57 +0200

Author: wachs
Date: 2010-06-01 16:14:57 +0200 (Tue, 01 Jun 2010)
New Revision: 11592

Modified:
   gnunet/src/transport/test_plugin_transport_http.c
Log:


Modified: gnunet/src/transport/test_plugin_transport_http.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_http.c   2010-06-01 13:39:00 UTC 
(rev 11591)
+++ gnunet/src/transport/test_plugin_transport_http.c   2010-06-01 14:14:57 UTC 
(rev 11592)
@@ -41,6 +41,7 @@
 
 #define VERBOSE GNUNET_YES
 #define DEBUG GNUNET_YES
+#define DEBUG_CURL GNUNET_NO
 
 #define PLUGIN libgnunet_plugin_transport_template
 
@@ -213,6 +214,10 @@
 {
   curl_multi_cleanup(multi_handle);
 
+  if (NULL != curl_handle)
+    curl_easy_cleanup (curl_handle);
+
+
   if (ti_send != GNUNET_SCHEDULER_NO_TASK)
   {
     GNUNET_SCHEDULER_cancel(sched,ti_send);
@@ -235,11 +240,9 @@
 
   GNUNET_SCHEDULER_shutdown(sched);
 
+  GNUNET_free(msg->buf);
+  GNUNET_free(msg);
 
-
-  //GNUNET_free(msg);
-  //GNUNET_free(msg->buf);
-
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting testcase\n");
   exit(fail);
   return;
@@ -339,6 +342,8 @@
 static void send_execute (void *cls,
              const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
+
+
   int running;
   struct CURLMsg *msg;
   CURLMcode mret;
@@ -378,21 +383,16 @@
                                __LINE__,
                                curl_easy_strerror (msg->data.result));
                     /* sending msg failed*/
-                    //if ( NULL != cs->transmit_cont)
-                    //  cs->transmit_cont (NULL,&cs->sender,GNUNET_SYSERR);
                     }
                   else
                     {
                     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                                 "Send completed.\n");
-                    //if (GNUNET_OK != remove_http_message(cs, 
cs->pending_outbound_msg))
-                      //GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message could 
not be removed from session `%s'", GNUNET_i2s(&cs->sender));
-
-                    curl_easy_cleanup(curl_handle);
-                    curl_handle=NULL;
-                    shutdown_clean();
-
+                    /* sending completed */
                     }
+                  curl_easy_cleanup(curl_handle);
+                  curl_handle=NULL;
+                  shutdown_clean();
                   return;
                 default:
                   break;
@@ -469,14 +469,16 @@
  */
 static int send_data(struct HTTP_Message *msg, char * url)
 {
-  //return GNUNET_OK;
+
   curl_handle = curl_easy_init();
   if( NULL == curl_handle)
   {
     printf("easy_init failed \n");
     return GNUNET_SYSERR;
   }
+#if DEBUG_CURL
   curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1L);
+#endif
   curl_easy_setopt(curl_handle, CURLOPT_URL, url);
   curl_easy_setopt(curl_handle, CURLOPT_PUT, 1L);
   curl_easy_setopt (curl_handle, CURLOPT_WRITEFUNCTION, &copyBuffer);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]