File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
pymatbridge/matlab/functions Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 53
53
case ' write'
54
54
if (~isa(data ,' int8' )), error(' TCP:input' ,' Data must be of type int8' ); end
55
55
try
56
- DataOutputStream(TCP .outputStream ).write(data ,0 ,length(data ));
56
+ % in older versions of matlab, this gives an error about
57
+ % static constructors;
58
+ % DataOutputStream(TCP.outputStream).write(data,0,length(data));
59
+ dostr = DataOutputStream(TCP .outputStream );
60
+ dostr .write(data ,0 ,length(data ));
57
61
catch
58
62
end
59
63
try
64
+ % this might also barf if you change it to flush(), I believe.
60
65
DataOutputStream(TCP .outputStream ).flush;
61
66
catch
62
67
end
Original file line number Diff line number Diff line change 9
9
switch (lower(type ))
10
10
case ' get'
11
11
header.Get.Filename= request_words{i }{2 };
12
- header.Get.Protocol= request_words{i }{3 };
12
+ if (numel(request_words{i }) > 2 )
13
+ header.Get.Protocol= request_words{i }{3 };
14
+ else
15
+ header.Get.Protocol = ' none_given'
16
+ end
13
17
case ' post'
14
18
header.Post.Filename= request_words{i }{2 };
15
- header.Post.Protocol= request_words{i }{3 };
19
+ if (numel(request_words{i }) > 2 )
20
+ header.Post.Protocol= request_words{i }{3 };
21
+ else
22
+ header.Post.Protocol = ' none_given'
23
+ end
16
24
case ' host:'
17
25
header.Host= rmvp(line(7 : end ));
18
26
case ' user-agent:'
82
90
otherwise
83
91
disp(' unknown' )
84
92
end
85
- end
93
+ end
You can’t perform that action at this time.
0 commit comments