473,805 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error in Apache module...

Hi,

we are trying to create an apache module which catch web requests and
does evaluation of the content_type string.

Here a snippet:

.....
char *type = ap_table_get(r->headers_in, "Content-Type");
char *posizione = strstr(type,"ht ml");
.....

....but when we evaluate posizione....

if (posizione == NULL) return OK;

I get a blank page with header RESPONSE: HTTP/0.9 200 OK - probably
there is a runtime error. I am a newbie in Apache Modules, please let
me know where is the error.

Thanks!

Jun 19 '07 #1
3 1770
vi************* ***@gmail.com wrote:
>
Hi,

we are trying to create an apache module which catch web requests and
does evaluation of the content_type string.

Here a snippet:

....
char *type = ap_table_get(r->headers_in, "Content-Type");
Does (type) point to a string at this point in code?
char *posizione = strstr(type,"ht ml");
....

...but when we evaluate posizione....

if (posizione == NULL) return OK;

I get a blank page with header RESPONSE: HTTP/0.9 200 OK - probably
there is a runtime error. I am a newbie in Apache Modules, please let
me know where is the error.
--
pete
Jun 19 '07 #2
Yes, "type" points to a string, but we don't understand because there
is a runtime error when we evaluate "posizione" .

The runtime error give us in output a blank web page bacause this sw
is an Apache Module.
Any idea?

pete ha scritto:
vi************* ***@gmail.com wrote:

Hi,

we are trying to create an apache module which catch web requests and
does evaluation of the content_type string.

Here a snippet:

....
char *type = ap_table_get(r->headers_in, "Content-Type");

Does (type) point to a string at this point in code?
char *posizione = strstr(type,"ht ml");
....

...but when we evaluate posizione....

if (posizione == NULL) return OK;

I get a blank page with header RESPONSE: HTTP/0.9 200 OK - probably
there is a runtime error. I am a newbie in Apache Modules, please let
me know where is the error.

--
pete
Jun 20 '07 #3
On Wed, 20 Jun 2007 03:21:28 -0700, in comp.lang.c ,
vi************* ***@gmail.com wrote:
>Yes, "type" points to a string,
So during the execution of the code, you are sure that at the point
which pete marked, 'type' is really pointing to a valid string, and
not to garbage or null or something? Can you printf the string to
console or into a file or something?
>but we don't understand because there
is a runtime error when we evaluate "posizione" .
'type' is not pointing to a string which contains the letters
'html',and so posizione is null?
>The runtime error
are you actually getting an error or is this just your guess as to
what is wrong?
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jun 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
68850
by: Randell D. | last post by:
Folks, I feel like pulling my hair out - I tried unsuccessfully over the past few days to install ImagMagick but because of version conflicts and missing libraries I had to give up. I originally choose ImageMagick because I've heard so much about it. I then decided to go with the inbuilt GD tools since I'm using PHP 4.3.3 that I compiled with --with-gd. I can use some of the image functions in PHP so why is this one undefined? What...
2
3161
by: Tony | last post by:
bash-2.03# /configure --with-apxs=/usr/local/apache/bin/apxs --with-zlib=/usr /local --with-db3=/opt/sfw --with-openssl=/usr/local/ssl/ --enable-module=so loading cache ./config.cache checking host system type... i386-pc-solaris2.8 checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc...
0
1801
by: Adam Smith | last post by:
Hello, Installing PHP 4.3.6 on a i386 platform w/ FreeBSD 4.9 O/S installed and running apache_1.3.31 make with ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --enable-versioning ===> ......... Configuring SAPI modules
0
1881
by: Darek | last post by:
Hello, I'm trying to install PHP5. My configure is ../configure --with-apxs=/usr/local/sbin/apxs -- prefix=PREFIX=/usr/local/php5/ --with-mysql --disable-pear then make and make install The error that I get is:
0
992
by: charliek | last post by:
I have mod_python 2.7.10 running with python 2.3.4 and am getting an odd error. The error is happening on the production machine, and not on my development machine. I am using the publisher handler and am calling the index function with this code: ---------------------------------- from mod_python import apache import random
0
1608
by: Julien Cigar | last post by:
Hello, I'm using mod_python 3.1.3 with Apache 2.0.54 on a Debian box with the publisher handler and the Clearsilver template engine, and from time to time apache returns an 500 error code (Internal Server Error). Apache errog.log file looks like : PythonHandler mod_python.publisher: Traceback (most recent call last): PythonHandler
0
2647
by: Subodh | last post by:
I'm trying to make a HTTP request to a Web server. The Perl module is executed in mod_perl on Apache 1.3 The code : ---------------- my $r = shift; my $browser = LWP::UserAgent->new( ); $url = 'http://10.3.8.137/'; my $response = $browser->get($url); my $response_line = $response->status_line();
19
1387
by: art | last post by:
Hi, I am running PHP 4.3.9 and Apache 2.0.52. This is the error: an unknown filter was not added: PHP I've read over 40 suggestions with no luck. Can anyone help? I am running Cent-OS. does anyone need to see my config files? Anything would help....
10
6982
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10356
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10103
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7644
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.