Re: [Vala] libsoup Session.Async does not send stuff

2013-10-28 Thread Nor Jaidi Tuah
On Mon, 2013-10-28 at 21:39 +0100, Daniel Brendle wrote:
> > Perhaps this is the offending line:
> > unowned ProxyServer self = server as ProxyServer;
> >
> > Try removing "unowned" unless you are sure that
> > the Server is never freed.
>
> I tried it, but it did not do the trick, i also tried to compile the
> code with the newest vala-compiler (0.22), but it did not make a
> difference (i used 0.16 before). Could the Problem be the two nested
> asynchronous contexts? I am not exactly sure how those closures work.

Have you tried running from command line and
see what those printfs have to say? I doubt
there is any problem with the nested closures.

Nice day
Nor Jaidi Tuah




PRIVILEGED/CONFIDENTIAL information may be contained in this message. If you 
are neither the addressee (intended recipient) nor an authorised recipient of 
the addressee, and have received this message in error, please destroy this 
message (including attachments) and notify the sender immediately. STRICT 
PROHIBITION: This message, whether in part or in whole, should not be reviewed, 
retained, copied, reused, disclosed, distributed or used for any purpose 
whatsoever. Such unauthorised use may be unlawful and may contain material 
protected by the Official Secrets Act (Cap 153) of the Laws of Brunei 
Darussalam. DISCLAIMER: We/This Department/The Government of Brunei Darussalam, 
accept[s] no responsibility for loss or damage arising from the use of this 
message in any manner whatsoever. Our messages are checked for viruses but we 
do not accept liability for any viruses which may be transmitted in or with 
this message.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] libsoup Session.Async does not send stuff

2013-10-28 Thread Daniel Brendle
> Perhaps this is the offending line:
> unowned ProxyServer self = server as ProxyServer;
> 
> Try removing "unowned" unless you are sure that
> the Server is never freed.

I tried it, but it did not do the trick, i also tried to compile the
code with the newest vala-compiler (0.22), but it did not make a
difference (i used 0.16 before). Could the Problem be the two nested
asynchronous contexts? I am not exactly sure how those closures work.

Regards.


signature.asc
Description: This is a digitally signed message part
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] [Fwd: Binary File is not seekable ?!?]

2013-10-28 Thread raum
from http://valadoc.org/#!api=gio-2.0/GLib.Seekable
seek on FileIOStream run without error but seeking with DataInputStream
throw an error but none on Windows... :-?
I will try to change my source code to test.

code sample.vala
public static int main (string[] args) {
File file = File.new_for_path ("my-test.txt");

try {
FileIOStream ios =  file.open_readwrite();

// no error
assert (ios.can_seek ());
// no error
ios.seek (11, SeekType.SET);

InputStream @is = ios.input_stream;
DataInputStream dis = new DataInputStream (@is);

string line;
while ((line = dis.read_line ()) != null) {
stdout.puts (line);
stdout.putc ('\n');
}

// display error
dis.seek(0,SeekType.SET);

} catch (Error e) {
stdout.printf ("Error: %s\n", e.message);
}

return 0;
}


OUTPUT

$ cat my-test.txt
My first line
My second line

$ valac --pkg gio-2.0 sample.vala
cyriac@arche:~/src$ ./sample
ne
My second line

(process:29159): GLib-GIO-CRITICAL **: g_seekable_seek: assertion
`G_IS_SEEKABLE (seekable)' failed

> I've downloaded source tarball of Vala 0.22, compiled and install it but
> no effect... :-/
>
> I was wondering if it was not a system problem. But I can not admit that I
> would have to reinstall linux to make it work. I'll search for reinstall
> only glib
>
> Thanks
>
> Raum
>
>> Seems like it is problem with glib2 package, try to reinstall it, I
>> can't
>> say how it exactly called in Ubuntu, because I'm not an Ubuntu user.
>>  
>>  
>>  
>>   From:
>> raum@no-log.orgSent:
>> ??,
>> 26
>> ??
>> 2013
>> ?.
>> 22:17To:
>> vala-list@gnome.orgSubject:
>> Re:
>> [Vala]
>> [Fwd:
>> Binary
>> File
>> is
>> not
>> seekable
>> ?!?]
>> Hello,
>>
>> Let me explain. I want to create a tool for Linux and Windows.
>>
>> I need to open a binary file and seek to a position... With MingW on
>> Windows, it runs without error but on Linux, I've a "seekable" error
>> with
>> the same code, same compile options, etc.
>>
>> I dont understand why...
>>
>> # Code
>>
>>  public void main() {
>> try {
>>File file = File.new_for_path ("test.pcap");
>>DataInputStream dis = new DataInputStream (file.read ());
>>stdout.printf("seekable: %s\n",(dis.can_seek())?"true":"false");
>> } catch (Error e) {
>> }
>>  }
>>
>> # WINDOWS 32bits / MingW32
>>
>> $ valac --pkg gio-2.0 seek.vala
>> $ ./seek
>> seekable: true
>>
>> ## LINUX -Ubuntu 13.03- 64 bits
>>
>> $ valac --pkg gio-2.0 seek.vala
>> $ ./seek
>> (process:8097): GLib-GIO-CRITICAL **: g_seekable_can_seek: assertion
>> `G_IS_SEEKABLE (seekable)' failed
>> seekable: false
>>
>>
>> Do you have an idea why it's running on Windows but not on Linux ?
>>
>> Thanks
>>
>> Raum
>> ___
>> vala-list mailing list
>>
>> https://mail.gnome.org/mailman/listinfo/vala-list
>>
>
> ___
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list