Linux-Development-Apps Digest #477, Volume #7    Sun, 17 Jun 01 21:13:08 EDT

Contents:
  write blocking in a server! (Carlos Moreno)
  Invalid module sturcture - check UIL module syntax ("Saji R")
  Re: kylix (Friedrich Dominicus)
  Re: kylix (Friedrich Dominicus)
  modem programming (fuzzy)
  Re: HTTP download question (Daniel Barron)
  Re: How can I know if the file has been changed ? (HELP) ("KevinC")
  Re: Button images?? (Michael Linnemann)
  Apache, CGI and file upload (Zeljko Vrba)
  Re: Apache, CGI and file upload (Hrvoje Niksic)
  crypt() won't be found by the linker (Uwe Bosse)
  Re: crypt() won't be found by the linker (Carlos Moreno)
  Guru help needed with dlopen issue (Harald Villinger)
  Re: Apache, CGI and file upload (Zeljko Vrba)
  Re: crypt() won't be found by the linker ("Eugene Mayevski")
  Re: sockets: anyone recognizes this symptom on a server? (Ferenc Wagner)
  Re: bin and cue files ("wordless")
  Re: kylix (Matthias Leisi)
  Re: bin and cue files (Harald Villinger)
  Re: Guru help needed with dlopen issue ("Paul Pluzhnikov")
  Getting the Text from a gtk_list_item_new_with_label (Derek Mark Edding)

----------------------------------------------------------------------------

From: Carlos Moreno <[EMAIL PROTECTED]>
Subject: write blocking in a server!
Date: Sun, 17 Jun 2001 01:28:16 -0400


Hi,

This is a follow-up to the problem I was describing in my 
other post ("anyone recognizes this symptom?"). 

I'm using a loop with select to serve multiple clients; 
after the select, I either do read, accept, or close. 
After the read, there is processing that may or may not 
lead to single or multiple write commands (in response 
to the incoming packet).

Now, as a couple of people suggested, there is a call 
that is blocking when it shouldn't.  After using strace 
to monitor what happens, I discovered that it was a 
write command the one that was blocking!!!  (*gasp*!!!)

How is that possible?  Is it because the connection 
dropped right before issuing the write?  Shouldn't 
the system be immune to that?  Here's a log of the 
last few calls before freezing, and then the first 
few calls after it "unfroze":

Before freezing:

write(1, "2013 19 : upgm T3%2Dserie4E 1 1 "..., 38) = 38
write(4, "upgm T3%2Dserie4E 1 1 0 0 5\n\0", 29) = 29
time(NULL)                              = 992736807
write(17, "upgm T3%2Dserie4E 1 1 0 0 5\n\0", 29) = 29
time(NULL)                              = 992736807
write(28, "upgm T3%2Dserie4E 1 1 0 0 5\n\0", 29) = 29
time(NULL)                              = 992736807
write(32, "upgm T3%2Dserie4E 1 1 0 0 5\n\0", 29) = 29
time(NULL)                              = 992736807
write(6, "upgm T3%2Dserie4E 1 1 0 0 5\n\0", 29 <unfinished ...>


After unfreezing:

write(6, "p_join CRP 0\n\0", 14)        = -1 ETIMEDOUT (Connection timed
out)
time(NULL)                              = 992737095
write(26, "p_join CRP 0\n\0", 14)       = 14
time(NULL)                              = 992737095
write(22, "p_join CRP 0\n\0", 14)       = 14
time(NULL)                              = 992737095
write(29, "p_join CRP 0\n\0", 14)       = -1 EPIPE (Broken pipe)
time(NULL)                              = 992737095
write(16, "p_join CRP 0\n\0", 14)       = 14
time(NULL)                              = 992737095

Now, I wonder why that connection timed out -- notice that 
it is not the same packet as the last one recorded before 
freezing...   Also, I wonder what could have happened with 
that broken pipe, a few messages later (to a different socket, 
BTW...) 

I'll investigate to try and identify the problem and find a 
solution, but since my experience with this is limited, I'll 
be most grateful for any suggestions you may have concerning 
why could this be happening, and possible ways of fixing the 
problem... 

Thanks for your help so far, and thanks in advance for any 
extra ideas you may have! 

Cheers,

Carlos
--

------------------------------

From: "Saji R" <[EMAIL PROTECTED]>
Crossposted-To: ahn.tech.linux,cern.linux
Subject: Invalid module sturcture - check UIL module syntax
Date: Sun, 17 Jun 2001 10:59:31 +0530

Hi All,
    I have a strange problem. I have the following uil module and while i am
compiling i am getting an error saying that invalid module strcure. But i
referred to a book, and the url syntax which i wrote is corret. Can any one
tell me what is wrong with it?

module XApplication
    version = 'v1.0'
    names = case_sensitive

include file "XmAppl.uil";

procedure
 create_proc(integer);

object error_dialog : XmForm {
 controls{
  XmLabel passwd_label;
 };
 arguments {
  XmNwidth = 290;
  XmNheight = 90;
 };
};

object passwd_label : XmLabel {
 arguments {
  XmNtopAttachment = XmATTACH_FORM;
  XmNleftAttachment = XmATTACH_FORM;
  XmNtopOffset = 14;
  XmNleftOffset = 15;
  XmNlabelString = "Password:";
 };
};
end module;



Is there any code beautifier available for the uil?
Regards,
Saji R









------------------------------

From: Friedrich Dominicus <[EMAIL PROTECTED]>
Subject: Re: kylix
Date: 17 Jun 2001 08:41:02 +0200

"Rosimildo daSilva" <[EMAIL PROTECTED]> writes:

> "Friedrich Dominicus" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > [EMAIL PROTECTED] (quux111) writes:
> >
> >
> > I would really know even one professional developer for whom a thousand
> > dollars is to expensive.
> 
> It is not for US levels of salary. In India, China, and Russia salaries are
> around $300/month. This means almost a quarter of a year to pay for
> a tool.
Now a acutal working place in industry costs at least 200 000 DM in
Germany. The average salary is around 60 000 DM, this means the worker
must work 3 years just to pay the working place. If the same is true
for Indi than the software + hardware can cost at least 10 800
Dollar. Now the computer costs around $ 2000 a deskt with table let's
say another $2000 then there are still $6000 left for software.

Now tell me, why is it ok that a normal workplace is as expensive as
pointed out but why is a programmers workplace different?

Friedrich

------------------------------

From: Friedrich Dominicus <[EMAIL PROTECTED]>
Subject: Re: kylix
Date: 17 Jun 2001 08:42:13 +0200

[EMAIL PROTECTED] (James) writes:

> POSSL ( http://www.possl.org ) is a free opensource RAD tool for
> linux.  It supports character mode, Motif, the web, and EJBs.  You can
> write your code in C/C++
Try out Mozart-Oz a true multiparadigmen langauge.
www.mozart-oz.org

or DrScheme (a free Scheme running everywhere on the desktop"

or

or

Friedrich

------------------------------

Subject: modem programming
From: [EMAIL PROTECTED] (fuzzy)
Date: 17 Jun 2001 18:08:26 +1000

heres the problem...( other than just needing all kinds of help.. )..

platform: linux
lang    : C

i need to embed functionality into an app that can detect a modem ring, direct 
modem to answer and hangup as required. Std modem connected to a serial comms 
port ( cannot use mgetty ).

any help, pointers :) in the right direction etc gratefully acknowledged with a 
YAHOOO.

in advance ta,
fuzzy





------------------------------

From: Daniel Barron <[EMAIL PROTECTED]>
Subject: Re: HTTP download question
Date: Sun, 17 Jun 2001 11:39:29 GMT

In message <[EMAIL PROTECTED]>
          [EMAIL PROTECTED] (Villy Kruse) wrote:
[snip]
> 
> A hardware interrupt is handled by the kernel and don't affect the read,
> except if it generates a signal.  
> 
> Should that be the case then you will get a short read, that is you
> get less than you asked for, but you would get that with recv as well.
> If the read returns with -1 and errno == EINTR, you just repeate the read;
> no problems.  

Would this also be for write/send?  The errno == EINTR is what I refer to.

-- 
Daniel Barron - use [at jadeb.com] for personal replys.


------------------------------

From: "KevinC" <[EMAIL PROTECTED]>
Subject: Re: How can I know if the file has been changed ? (HELP)
Date: Sun, 17 Jun 2001 20:17:15 +0800

Thanks, It is exact what I want.
I am not sure if it will work on 2.2.13.
But I will try to find some useful function based on this example.

> If portability isn't important, you may try this code:
> [it uses experimantal feature, and won't work on 2.0.x, and, possibly,
> on 2.2.x]




------------------------------

From: [EMAIL PROTECTED] (Michael Linnemann)
Subject: Re: Button images??
Date: Sun, 17 Jun 2001 15:00:41 +0200

Am Sat, 16 Jun 2001 20:19:06 -0700 Jon Simmons wrote:

>Hi, I'm a LINUX newbie exploring the development opportunities and am
>wondering one very simple thing: is it possible to change a standard button
>(or any other objects for that matter) to a button w/ an image??  The only
>properties I have seen so far are color, size and relief (actually, I don't
>even see color and size here?:
>http://developer.gnome.org/doc/API/gtk/gtkbutton.html ).

A GtkButton is a container, and a container can only contain one
element. Just place a vbox, hbox, table or whatever on a button to make
your preferred button layout.

Seems you should read a little further about Gtk+; especially about the
container approach to widget placement and inheritance - that would
answer your questions WRT size and color properties.

Regards
Michael

------------------------------

From: [EMAIL PROTECTED] (Zeljko Vrba)
Crossposted-To: comp.lang.perl.modules,hr.comp.programiranje,hr.comp.programiranje.www
Subject: Apache, CGI and file upload
Date: 17 Jun 2001 14:28:13 GMT
Reply-To: [EMAIL PROTECTED]

[ Isprika za engleski clanak, ali saljem i na ne-hrvatske grupe. / My apologies
  for article in English, but I'm also posting to non-Croatian newsgroups. ]

Basically, I need to upload an unknown amount of data (I know when it ends,
but I don't know in advance how much there is) to a CGI script, within a SINGLE
HTTP POST request. Is this possible and how? (specify the complete HTTP request
headers..) I'm using mod_perl and Apache. A simple example program that 
accepts such data would also be helpful.

I'm asking because Apache seems to accept the message body only if 
Content-Length header is present, and I can't include it for obvious reasons.

Set followup to any group that seems appropriate for this question.

Thanks!


------------------------------

From: Hrvoje Niksic <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.perl.modules,hr.comp.programiranje,hr.comp.programiranje.www
Subject: Re: Apache, CGI and file upload
Date: 17 Jun 2001 17:03:35 +0200

[EMAIL PROTECTED] (Zeljko Vrba) writes:

> [ Isprika za engleski clanak, ali saljem i na ne-hrvatske grupe. / My apologies
>   for article in English, but I'm also posting to non-Croatian newsgroups. ]
> 
> Basically, I need to upload an unknown amount of data (I know when
> it ends, but I don't know in advance how much there is) to a CGI
> script, within a SINGLE HTTP POST request. Is this possible and how? 
> (specify the complete HTTP request headers..) I'm using mod_perl and
> Apache. A simple example program that accepts such data would also
> be helpful.

If you can rely that the server/CGI speak HTTP/1.1, you can use the
"chunked" content transfer for your request body.  See section 3.6.1
of rfc2616 for a description of chunked transfer.

If you're constrained to HTTP/1.0, I'm afraid you'll have to split up
the body into multiple requests.

------------------------------

From: Uwe Bosse <[EMAIL PROTECTED]>
Subject: crypt() won't be found by the linker
Date: Sun, 17 Jun 2001 17:05:01 +0200

I want to check, whether a password given by a user is correct or not.
I found the following manpage for crypt:

#define _XOPEN_SOURCE
#include <unistd.h> 

char *crypt(const char *key, const char *salt); 

... and thought, this is, what I have been looking for.
Take the users password, crypt it and compare the result with the
contents of /etc/passwd.
But the following went wrong:
first g++ didn't find the header of crypt. After a look at unistd.h I
changed
#define _XOPEN_SOURCE into
#define __USE_XOPEN
Now, the compilation succeeded, but the linker told me:
undefined reference to 'crypt'.

What is my mistake?

------------------------------

From: Carlos Moreno <[EMAIL PROTECTED]>
Subject: Re: crypt() won't be found by the linker
Date: Sun, 17 Jun 2001 11:29:43 -0400


Uwe Bosse wrote:
> 
> Now, the compilation succeeded, but the linker told me:
> undefined reference to 'crypt'.
> 
> What is my mistake?

Did you use the switch -lcrypt when compiling? 

Carlos
--

------------------------------

From: Harald Villinger <[EMAIL PROTECTED]>
Subject: Guru help needed with dlopen issue
Date: Sun, 17 Jun 2001 17:36:27 +0200

Hi,

I develop a library which will load modules (shared libraries) in a
given directory with dlopen.

I use libtool to build the modules.

After my library was working so far I implemented a little module
which works. Then I started my 2nd modul from code of the first,
and also my lib found the 2 modules and loaded them.

After heavy work on the 2nd module, which depends on other librarys,
when I load both modules strange things happen.

First I saw that the string array which holds my modulepath got
corrupted.
I use glob() to find my modules and had a loop like:

for(count=0; count<num_found; count++)
{
  ...
   Handle[count]=dlopen(Glob.gl_pathv[iCount],RTLD_NOW);
   ...
   module_init =   dlsym(  Handle[count], "module_init");
   x = module_init;
   ...
}

after initialisation of module1 the Glob.gl_pathv was filled with random
characters.

I solved this by copying the strings into a seperate string array before
dlopen()
but then my 1st module try's to use strerror(errno) and I get a
segfault.
It is not depending which one I load first.

with LD_DEBUG=bindings,files,reloc,libs the last 2 lines before segfault
are :

18231:  binding file /lib/libc.so.6 to /lib/libc.so.6: normal symbol
`__strerror_r' [GLIBC_2.0]
18231:  binding file /lib/libc.so.6 to /lib/libc.so.6: normal symbol
`__dcgettext' [GLIBC_2.0]

If I try one module at a time they seem to work. I couldn't figure out
how
I have to set libtool options to get my lib to work. I think gimp and
other
programms do similar things, but I could not find anything helpfull so
far.

thanks in advance

Harald

------------------------------

From: [EMAIL PROTECTED] (Zeljko Vrba)
Crossposted-To: comp.lang.perl.modules,hr.comp.programiranje,hr.comp.programiranje.www
Subject: Re: Apache, CGI and file upload
Date: 17 Jun 2001 15:38:21 GMT
Reply-To: [EMAIL PROTECTED]

On 17 Jun 2001 17:03:35 +0200, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> 
> If you can rely that the server/CGI speak HTTP/1.1, you can use the
> "chunked" content transfer for your request body.  See section 3.6.1
> of rfc2616 for a description of chunked transfer.
> 
> If you're constrained to HTTP/1.0, I'm afraid you'll have to split up
> the body into multiple requests.
>
I've tried adding Transfer-Encoding: chunked header, but Apache responds with
"chunked encoding forbidden" (I think error code is 500). And I say

POST /perl/whatever.pl HTTP/1.1

However, Apache always responds with 200 OK HTTP/1.0 ...
How to fix it?


------------------------------

From: "Eugene Mayevski" <[EMAIL PROTECTED]>
Subject: Re: crypt() won't be found by the linker
Date: Sun, 17 Jun 2001 19:01:26 +0300

> Now, the compilation succeeded, but the linker told me:
> undefined reference to 'crypt'.
> What is my mistake?

Add -lcrypt to compiler command line.


--
Sincerely yours,
Eugene Mayevski



------------------------------

From: Ferenc Wagner <[EMAIL PROTECTED]>
Subject: Re: sockets: anyone recognizes this symptom on a server?
Date: 17 Jun 2001 22:12:06 +0200
Reply-To: [EMAIL PROTECTED]

Carlos Moreno <[EMAIL PROTECTED]> writes:

> If I press ctrl-C, then the server is gone

You can say 'cont' to gdb to continue execution after you
checked the state of your program.

                                        Feri.

------------------------------

From: "wordless" <[EMAIL PROTECTED]>
Subject: Re: bin and cue files
Date: Sun, 17 Jun 2001 19:07:58 +0800

Try "winimage" to open such files.

"filipe" <[EMAIL PROTECTED]> wrote in message
news:9gd0an$muo$[EMAIL PROTECTED]...
> i need to know what can do with this type of files.
>
>



------------------------------

From: [EMAIL PROTECTED] (Matthias Leisi)
Subject: Re: kylix
Date: Sun, 17 Jun 2001 23:27:19 +0200

quux111 in comp.os.linux.development.apps:

>It is in fact very *expensive* software -- $999 for a single-seat developer 
>license was the last figure I heard, which puts this package firmly outside 

Borland has lowered its prices significantly in the previous
weeks (199 US$ and up), and a "free" (as in beer) version is due
somewhere mid year. (The CLX class library is free as in speech,
see http://freeclx.sourceforge.net/)


>Digression: The core library of both Delphi and C++ builder, the VCL, is 
>written in Object Pascal.  This means it is an absolute grotendous pain in 
>the ass when used with C++, not to mention butt-slow.  But that is a rant 
>for another day....

The VCL is Windows-only, and the new library, CLX, will be both
crossplatform[1] and crosslanguage[2]. As for its performance:
benchmarks gladly appreciated ;)

Regards,
Matthias

[1] not really crossplatform: Win/x86, Linux/x86
[2] not really crosslanguage: Delphi/Kylix (Borland Object
    Pascal), Borland C++

-- 
Swiss Internet User Group                  Jetzt Mitglied werden!
            http://www.siug.ch/about/mitglieder/

------------------------------

From: Harald Villinger <[EMAIL PROTECTED]>
Subject: Re: bin and cue files
Date: Mon, 18 Jun 2001 00:17:45 +0200
Reply-To: Harald <[EMAIL PROTECTED]>

filipe wrote:
> 
> i need to know what can do with this type of files.

AFAIK GNU cdimager generates a .bin CD image and a .cue index.
you can burn a cd with cdrdao.

Maybe you can try to mount the .bin with "mount -o loop file.bin /mnt"

Harald

------------------------------

From: "Paul Pluzhnikov" <[EMAIL PROTECTED]>
Subject: Re: Guru help needed with dlopen issue
Date: Sun, 17 Jun 2001 22:40:33 GMT

"Harald Villinger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> After heavy work on the 2nd module, which depends on other librarys,
> when I load both modules strange things happen.
>
> First I saw that the string array which holds my modulepath got
> corrupted.
> I use glob() to find my modules and had a loop like:
>

Is glob() returning dynamically-allocated memory?

>
> I solved this by copying the strings into a seperate string array before
> dlopen()
> but then my 1st module try's to use strerror(errno) and I get a
> segfault.

You did not solve the problem, you just made it move.
Most likely you are corrupting dynamic memory (allocating too little,
or free()ing twice, etc.), and both of your libraries probably make
the same mistake (since the second was derived from the first ;-)

Malloc debuggers, such as mpatrol, efence or Insure++ are your best bet.




------------------------------

From: [EMAIL PROTECTED] (Derek Mark Edding)
Subject: Getting the Text from a gtk_list_item_new_with_label
Date: Mon, 18 Jun 2001 01:05:27 GMT


Hi Folks,

I've scanned all of the likely sources for this information without any luck.

I'm building a GtkList with label objects using gtk_list_item_new_with_label().
What I want to accomplish is to have the user select an item from this list,
and click a button to populate an entry widget with the text of the item.

What I do is use the "select child" signal to execute a callback function that
provides a pointer to the selected item (a widget).  I then attempt to cast
this widget to be a label, and attempt to retrieve its text:

   GtkWidget* selectedWidget = data;
   gchar*     selectedWidgetStr;

   gtk_label_get( GTK_LABEL(selectedWidget), &selectedWidgetStr );

This doesn't work.  The pointer selectedWidgetStr winds up pointing to memory
outside the application's address space, and any subsequent use of the pointer
results in a segfault.  I'm guessing that a gtk_list_item is a different animal
than a GtkLabel and can't be made to behave like one.  Unfortunately, there are
only a scant handful of functions dealing with gtk_list_items in GTK+ 1.2, and 
none of them provide access to the text.

I'm about to resort to maintaining a separate array of these strings to get
around this problem, but coming from the Motif world I'm of the opinion that
there's a kludge-free way to accomplish this.

Any ideas?

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~ Derek Mark Edding ~~~~~~~~~~~~~~~ [EMAIL PROTECTED] ~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~ "An end to BS on Usenet in Our Lifetimes!" ~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to the
comp.os.linux.development.apps newsgroup.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-Apps Digest
******************************

Reply via email to