diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-09-07 13:30:39 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-09-07 13:30:39 +0000 |
commit | e3a246d526ab3df078e6f061827abfbf3f3b9ecb (patch) | |
tree | f5ba0d3b7d4ee88bd5418aa4b1ab28e38a384d49 /src/transport/plugin_transport_http.c | |
parent | 087c350b59a24467dfc9d922270b288bb17eb241 (diff) | |
download | gnunet-e3a246d526ab3df078e6f061827abfbf3f3b9ecb.tar.gz gnunet-e3a246d526ab3df078e6f061827abfbf3f3b9ecb.zip |
Improved documentation
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r-- | src/transport/plugin_transport_http.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index 1fb318b85..44e4c9aba 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -1269,6 +1269,16 @@ static size_t curl_get_header_cb( void *ptr, size_t size, size_t nmemb, void *st | |||
1269 | return size * nmemb; | 1269 | return size * nmemb; |
1270 | } | 1270 | } |
1271 | 1271 | ||
1272 | /** | ||
1273 | * Callback called by libcurl when new headers arrive | ||
1274 | * Used to get HTTP result for curl operations | ||
1275 | * @param ptr stream to read from | ||
1276 | * @param size size of one char element | ||
1277 | * @param nmemb number of char elements | ||
1278 | * @param stream closure set by user | ||
1279 | * @return bytes read by function | ||
1280 | */ | ||
1281 | |||
1272 | static size_t curl_put_header_cb( void *ptr, size_t size, size_t nmemb, void *stream) | 1282 | static size_t curl_put_header_cb( void *ptr, size_t size, size_t nmemb, void *stream) |
1273 | { | 1283 | { |
1274 | struct Session * ps = stream; | 1284 | struct Session * ps = stream; |
@@ -1433,6 +1443,12 @@ static size_t curl_receive_cb( void *stream, size_t size, size_t nmemb, void *pt | |||
1433 | 1443 | ||
1434 | } | 1444 | } |
1435 | 1445 | ||
1446 | /** | ||
1447 | * Task performing curl operations | ||
1448 | * @param cls plugin as closure | ||
1449 | * @param tc gnunet scheduler task context | ||
1450 | */ | ||
1451 | |||
1436 | static void curl_perform (void *cls, | 1452 | static void curl_perform (void *cls, |
1437 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 1453 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
1438 | { | 1454 | { |
@@ -1588,6 +1604,7 @@ static void curl_perform (void *cls, | |||
1588 | 1604 | ||
1589 | /** | 1605 | /** |
1590 | * Function setting up file descriptors and scheduling task to run | 1606 | * Function setting up file descriptors and scheduling task to run |
1607 | * | ||
1591 | * @param cls plugin as closure | 1608 | * @param cls plugin as closure |
1592 | * @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok | 1609 | * @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok |
1593 | */ | 1610 | */ |
@@ -1653,6 +1670,7 @@ static int curl_schedule(void *cls) | |||
1653 | 1670 | ||
1654 | /** | 1671 | /** |
1655 | * Function setting up curl handle and selecting message to send | 1672 | * Function setting up curl handle and selecting message to send |
1673 | * | ||
1656 | * @param cls plugin | 1674 | * @param cls plugin |
1657 | * @param ps session | 1675 | * @param ps session |
1658 | * @return GNUNET_SYSERR on failure, GNUNET_NO if connecting, GNUNET_YES if ok | 1676 | * @return GNUNET_SYSERR on failure, GNUNET_NO if connecting, GNUNET_YES if ok |
@@ -1815,6 +1833,18 @@ static ssize_t send_check_connections (void *cls, struct Session *ps) | |||
1815 | return GNUNET_SYSERR; | 1833 | return GNUNET_SYSERR; |
1816 | } | 1834 | } |
1817 | 1835 | ||
1836 | /** | ||
1837 | * select best session to transmit data to peer | ||
1838 | * | ||
1839 | * @param cls closure | ||
1840 | * @param pc peer context of target peer | ||
1841 | * @param addr address of target peer | ||
1842 | * @param addrlen address length | ||
1843 | * @param force_address does transport service enforce address? | ||
1844 | * @param session session passed by transport service | ||
1845 | * @return selected session | ||
1846 | * | ||
1847 | */ | ||
1818 | static struct Session * send_select_session (void * cls, struct HTTP_PeerContext *pc, const void * addr, size_t addrlen, int force_address, struct Session * session) | 1848 | static struct Session * send_select_session (void * cls, struct HTTP_PeerContext *pc, const void * addr, size_t addrlen, int force_address, struct Session * session) |
1819 | { | 1849 | { |
1820 | struct Session * tmp = NULL; | 1850 | struct Session * tmp = NULL; |