forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[ps2Client] problem when we load a irx file

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
Nippy



Joined: 15 Sep 2004
Posts: 6
Location: Bordeaux (France)

PostPosted: Wed Jun 01, 2005 9:00 am    Post subject: [ps2Client] problem when we load a irx file Reply with quote

Hi,
in ps2client we can't load a file bigger than 65536 bytes so i made a patch :D

Index: ps2link.c
===================================================================
RCS file: /home/ps2cvs/ps2client/src/ps2link.c,v
retrieving revision 1.28
diff -r1.28 ps2link.c
313c313,314
< int result = -1, size = -1; char buffer[65536];
---
> int result = -1, size = -1;
> char *buffer;
314a316
> buffer = malloc(ntohl(request->size));
322,323c324,326
< return network_send(request_socket, buffer, size);
<
---
> result = network_send(request_socket, buffer, size);
> free(buffer);
> return result;
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Jun 01, 2005 9:15 am    Post subject: Reply with quote

This is during execiop, right?

Strange.

Thanks for the patch, though. :)
Back to top
View user's profile Send private message Visit poster's website
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Wed Jun 01, 2005 9:52 pm    Post subject: Reply with quote

hello ooPo,

No, it's when you load an elf (execee) which load IRX bigger than 64Kb

cheers
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Jun 02, 2005 2:12 am    Post subject: Reply with quote

The reason I ask is that I was told the largest transfer to ever expect from ps2link would be 64k. I'm wondering if some part of ps2link may not be checking a buffer size somewhere and overflowing.
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Jun 02, 2005 5:58 am    Post subject: Reply with quote

Source in cvs has been updated. If a read or write is over 64k, it allocates a bigbuffer and uses that, otherwise it uses the same old buffer. This is to avoid a bunch of malloc/free calls when possible.

Thanks for pointing it out. :)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group