From 01b1359b1f8fe6d0501d18e223a232d7da06b21f Mon Sep 17 00:00:00 2001 From: nifi Date: Tue, 15 Jun 2010 14:19:22 +0000 Subject: [PATCH] removed unused (and slightly problematic) code --- core/net/psock.c | 54 +----------------------------------------------- core/net/psock.h | 9 +------- 2 files changed, 2 insertions(+), 61 deletions(-) diff --git a/core/net/psock.c b/core/net/psock.c index 784c83814..117618229 100644 --- a/core/net/psock.c +++ b/core/net/psock.c @@ -30,10 +30,9 @@ * * Author: Adam Dunkels * - * $Id: psock.c,v 1.11 2010/03/29 20:26:14 oliverschmidt Exp $ + * $Id: psock.c,v 1.12 2010/06/15 14:19:22 nifi Exp $ */ -#include #include #include "net/psock.h" @@ -326,54 +325,3 @@ psock_init(CC_REGISTER_ARG struct psock *psock, PT_INIT(&psock->psockpt); } /*---------------------------------------------------------------------------*/ -static char -copy_to_buf(const uint8_t **buffer, uint16_t *bufsize, const char **str) -{ - uint16_t len = strlen(*str); - uint16_t copysize = len; - - if(len > *bufsize) { - copysize = *bufsize; - } - - memcpy(*buffer, *str, copysize); - *bufsize -= copysize; - *buffer += copysize; - *str += copysize; - - return (*bufsize != 0); -} -/*---------------------------------------------------------------------------*/ -void -psock_buffered_string_send_begin(CC_REGISTER_ARG struct psock *s) -{ - s->state = STATE_NONE; - s->sendlen = uip_mss(); /* used as buf size */ - s->sendptr = uip_appdata; -} -/*---------------------------------------------------------------------------*/ -PT_THREAD(psock_buffered_string_send(CC_REGISTER_ARG struct psock *s, - const char **string, char push)) -{ - PT_BEGIN(&s->psockpt); - - do { - static char bufnotfull; - - s->state = STATE_NONE; - bufnotfull = copy_to_buf(&(s->sendptr), &(s->sendlen), string); - - if(!bufnotfull || push) { - - s->sendptr = uip_appdata; - s->sendlen = uip_mss() - (s->sendlen); - - PT_WAIT_UNTIL(&s->psockpt, data_is_sent_and_acked(s)); - - psock_buffered_string_send_begin(s); - } - } while(**string); - - PT_END(&s->psockpt); -} -/*---------------------------------------------------------------------------*/ diff --git a/core/net/psock.h b/core/net/psock.h index 7d22de1df..1d3a7fd3f 100644 --- a/core/net/psock.h +++ b/core/net/psock.h @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: psock.h,v 1.7 2010/03/24 21:03:32 adamdunkels Exp $ + * $Id: psock.h,v 1.8 2010/06/15 14:19:22 nifi Exp $ */ /** @@ -382,13 +382,6 @@ char psock_newdata(struct psock *s); #define PSOCK_WAIT_THREAD(psock, condition) \ PT_WAIT_THREAD(&((psock)->pt), (condition)) -void psock_buffered_string_send_begin(struct psock *s); -PT_THREAD(psock_buffered_string_send(struct psock *s, const char **string, char push)); - -#define PSOCK_BUFFERED_STRING_SEND(psock, str, push) \ - PT_WAIT_THREAD(&((psock)->pt), \ - psock_buffered_string_send(psock, str, push)) - #endif /* __PSOCK_H__ */ /** @} */