removed unused (and slightly problematic) code

This commit is contained in:
nifi 2010-06-15 14:19:22 +00:00
parent 46f9f7e6c0
commit 01b1359b1f
2 changed files with 2 additions and 61 deletions

View File

@ -30,10 +30,9 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $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 <stdio.h>
#include <string.h>
#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);
}
/*---------------------------------------------------------------------------*/

View File

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $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__ */
/** @} */