URL
https://opencores.org/ocsvn/plasma/plasma/trunk
[/] [plasma/] [trunk/] [kernel/] [netutil.c] - Diff between revs 416 and 419
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 416 |
Rev 419 |
Line 57... |
Line 57... |
static void FtpdReceiver(IPSocket *socket)
|
static void FtpdReceiver(IPSocket *socket)
|
{
|
{
|
unsigned char buf[600];
|
unsigned char buf[600];
|
int bytes, state = socket->state;
|
int bytes, state = socket->state;
|
FtpdInfo *info = (FtpdInfo*)socket->userPtr;
|
FtpdInfo *info = (FtpdInfo*)socket->userPtr;
|
|
int total = 0;
|
|
|
if(info == NULL || info->done)
|
if(info == NULL || info->done)
|
return;
|
return;
|
do
|
do
|
{
|
{
|
bytes = IPRead(socket, buf, sizeof(buf));
|
bytes = IPRead(socket, buf, sizeof(buf));
|
fwrite(buf, 1, bytes, info->file);
|
fwrite(buf, 1, bytes, info->file);
|
|
total += bytes;
|
} while(bytes);
|
} while(bytes);
|
|
|
if(state > IP_TCP)
|
if(state > IP_TCP && total == 0)
|
{
|
{
|
fclose(info->file);
|
fclose(info->file);
|
info->done = 1;
|
info->done = 1;
|
IPPrintf(info->socket, "226 Done\r\n");
|
IPPrintf(info->socket, "226 Done\r\n");
|
IPClose(socket);
|
IPClose(socket);
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.