TCP打印网页的帧缓冲只有1500个。
我里面建立的连接太多结果超出1500个了怎么办啊。
// prepare the webpage by writing the data to the tcp send buffer
unsigned int print_webpage(unsigned char *buf)//unsigned int in_static)
{
unsigned int plen;
const u8 sting_ONN[]="<font color=\"#FF0000\">[■]</font></a>";
const u8 sting_OFF[]="<font color=\"#00FF00\">[■]</font></a>";
plen = fill_tcp_data_p(buf,0,PSTR("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nPragma: no-cache\r\n\r\n"));
//-----------------------------------------------------------------------------------------
plen = fill_tcp_data_p(buf,plen,PSTR("<center><font size=\"16\">输出状态:"));
plen = fill_tcp_data_p(buf,plen,PSTR(s1_tt));
plen = fill_tcp_data_p(buf,plen,PSTR("<br><p>"));
//--------------------------------------------------------------
plen=fill_tcp_data_p(buf,plen,PSTR("01: "));
if(s1_tt[0]=='1'){
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/02222222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_ONN));
}
else {
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/12222222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_OFF));
}
plen=fill_tcp_data_p(buf,plen,PSTR("02: "));
if(s1_tt[1]=='1'){
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/20222222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_ONN));
}
else {
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/21222222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_OFF));
}
//plen = fill_tcp_data_p(buf,plen,PSTR("<br><p>"));
//---------------------------------------------------------------------
plen=fill_tcp_data_p(buf,plen,PSTR("03: "));
if(s1_tt[2]=='1'){
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22022222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_ONN));
}
else {
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22122222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_OFF));
}
plen=fill_tcp_data_p(buf,plen,PSTR("04: "));
if(s1_tt[3]=='1'){
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22202222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_ONN));
}
else {
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22212222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_OFF));
}
plen = fill_tcp_data_p(buf,plen,PSTR("<br><p>"));
//--------------------------------------------------------------
plen=fill_tcp_data_p(buf,plen,PSTR("05: "));
if(s1_tt[4]=='1'){
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22220222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_ONN));
}
else {
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22221222\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_OFF));
}
plen=fill_tcp_data_p(buf,plen,PSTR("06: "));
if(s1_tt[5]=='1'){
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22222022\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_ONN));
}
else {
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22222122\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_OFF));
}
//plen = fill_tcp_data_p(buf,plen,PSTR("<br><p>"));
//---------------------------------------------------------------------
plen=fill_tcp_data_p(buf,plen,PSTR("07: "));
if(s1_tt[6]=='1'){
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22222202\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_ONN));
}
else {
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22222212\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_OFF));
}
plen=fill_tcp_data_p(buf,plen,PSTR("08: "));
if(s1_tt[7]=='1'){
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22222220\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_ONN));
}
else {
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22222221\">"));
plen = fill_tcp_data_p(buf,plen,PSTR(sting_OFF));
}
plen = fill_tcp_data_p(buf,plen,PSTR("<br><p>"));
//--------------------------------------------------------------
//--------------------------------------------------------------
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/11111111\">[全开]</a>"));
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/00000000\">[全关]</a>"));
plen = fill_tcp_data_p(buf,plen,PSTR("<br><p>"));
//-----------------------------------------------------------------------------------------
plen = fill_tcp_data_p(buf,plen,PSTR("<font color=\"#FF0000\"> ■ </font>= 打开"));
plen = fill_tcp_data_p(buf,plen,PSTR("<font color=\"#00FF00\"> ■ </font>= 关闭"));
plen = fill_tcp_data_p(buf,plen,PSTR("<br><p>"));
plen = fill_tcp_data_p(buf,plen,PSTR("<a href=\""));//<small>
plen = fill_tcp_data(buf,plen,baseurl);
plen = fill_tcp_data(buf,plen,password);
plen = fill_tcp_data_p(buf,plen,PSTR("/22222222\">[刷新]</a>"));
return(plen);
}
signed char analyse_get_url(char *str)
{
unsigned char i=0;
unsigned char kkk=0;
//unsigned char t1,t2;
if (verify_password(str)==0)
{
return(-1);
}
// find first "/"
// passw not longer than 9 char:
while(*str && i<10 && *str >',' && *str<'{') //10
{
if (*str=='/')
{
str++;
break;
}
i++;
str++;
} //10 //-1
if(*str=='\0')return(0);
for(kkk=0;kkk<8;kkk++){
if(*str=='\0')return(0);
if (*str=='0'){
s1_tt[kkk]='0';
out_bit(kkk+1,1);
}
else if (*str=='1'){
s1_tt[kkk]='1';
out_bit(kkk+1,0);
}
str++;
}
return(0);
}
|