[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modules
Subject:    RE: [apache-modules] Module
From:       "Chris Evans" <chris.evans () openwave ! com>
Date:       2001-02-28 15:22:57
[Download RAW message or body]

I bet the file is not being opened and so is not read and hence you see
nothing from your file, habe you checked the permissions of /temp/file.

BTW if you send text instead of html the browser will still show the text

----------------------------------------
Chris Evans
Software Developer

Openwave.
Unit 1, Vo-Tec Centre, Hambridge lane, Newbury, Berkshire, RG14 5TN, UK
+44 1635 277550
Chris.Evans@openwave.com
----------------------------------------
Privacy and Confidentiality Notice:
The information contained in this electronic mail message is intended for
the named recipient(s) only. It may contain privileged and confidential
information. If you are not an intended recipient, you must not copy,
forward, distribute, or take any action in reliance on it. If you have
received this electronic mail message in error, please notify the sender
immediately.



-----Original Message-----
From: VirVit [mailto:virvit@udm.ru]
Sent: 28 February 2001 14:40
To: apache-modules@covalent.net
Subject: Re: [apache-modules] Module


You are wrong! Stop!!! I'am using direct output!!! Like none-parsed-headers
(nph) scripts!!!
If yor complie this code you'll see that I 'am  right!

Unless you send the html, head and body tags it will not show any thing.

--Gopi.

VirVit wrote:

> Who knows why this code doesn't work properly: it has to print to client
> header, some test words and file content but I see ONLY header and first
> wirds!!! I don't see file!!! Netscape Navigator writes that text from the
> file was recieved but doesn't show it me!
>
> static int test1_handler(request_rec *r)
> {
>     FILE *file_ptr;
>     char buf[HUGE_STRING_LEN];
>
>     if (createfile(r)==FALSE) return SERVER_ERROR;
>
>     mysend("HTTP/1.0 200 OK\r\n", r);
>     mysend("Content-type: text/html\r\n\r\n", r);
>
>     mysend("Start...<BR>\r\n", r);
>     mysend("Test!!!!<br>\r\n", r);
>
>     for(;;)
>     {
>
>          file_ptr = ap_pfopen(r->pool, "/tmp/file", "r");
>
>          if (file_ptr!=NULL)
>          {
>              while (fgets(buf, HUGE_STRING_LEN, file_ptr))
>              {
>               mysend(buf, r);
>                 /* Here I should see my file content but I don't  */
>
>              }
>              ap_pfclose(r->pool, file_ptr);
>          }
>
>      unlink("/tmp/file");
>     }
>
>     return OK;
> }
>
> void mysend(const char * buff ,request_rec *r)
> {
>     if(write(r->connection->client->fd, buff, strlen(buff))<0)
>     {
>         ap_log_error (APLOG_MARK, APLOG_ERR, r->server,
>         "Can't write to socket");
>     }
> }
>
> int createfile(request_rec *r)
> {
>     FILE * fout;
>     int res;
>     char * buffer = "Test, World!!!";
>
>     fout = fopen("/tmp/file", "wb");
>
>     res = fwrite(buffer, strlen(buffer), 1, fout);
>
>     if (res==0)
>     {
>         ap_log_error (APLOG_MARK, APLOG_ERR, r->server,
>     "Can't write to output file");
>         fclose(fout);
>      return FALSE;
>     }
>
>     fclose(fout);
>     return TRUE;
> }



--
----------------------------------------------------------------
Apache Modules Mailing List            670 currently subscribed
----------------------------------------------------------------

If you wish to be removed from this list, send the word
'unsubscribe' to: apache-modules-request@covalent.net




--
----------------------------------------------------------------
Apache Modules Mailing List            671 currently subscribed
----------------------------------------------------------------

If you wish to be removed from this list, send the word
'unsubscribe' to: apache-modules-request@covalent.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic