summaryrefslogblamecommitdiffstats
path: root/archives/extend/2014-August.txt
blob: 4903378bf7ffef9fbcce7c67f6a8ebb6fcf66240 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532



































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
From samset at wanadoo.fr  Mon Aug  4 18:39:26 2014
From: samset at wanadoo.fr (Samir Sow)
Date: Mon, 4 Aug 2014 18:39:26 +0200
Subject: [99s-extend] ranch dispatch error ver 1.0.0
Message-ID: <[email protected]>

Hi,

I?ve moved a working http server to https.
SSL handshaking is ok but i got the following Ranch error :

[error] Ranch listener https_mta had connection process started with cowboy_protocol:start_link/4 at <0.601.0> exit with reason: {badarg,[{binary,match,[[<<"com">>,<<"oockit">>,<<"www">>],<<".">>],[]},{cowboy_router,split_host,2,[{file,"src/cowboy_router.erl"},{line,305}]},{cowboy_router,match,3,[{file,"src/cowboy_router.erl"},{line,240}]},{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,169}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]}

call is

curl --cacert priv/cert/root.crt "https://www.oockit.com:7171/mtagw?


dispatch is 

[{'_', [
        {["/static/[...]"], cowboy_static, [{directory, {priv_dir, ?APP, [<<"static">>]}},
        {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
	{"/mtagw", hck_mta, []}
    ]}]).


Any clue ?

Thanks

sincerely

Samir


From essen at ninenines.eu  Mon Aug  4 18:49:32 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Mon, 04 Aug 2014 18:49:32 +0200
Subject: [99s-extend] ranch dispatch error ver 1.0.0
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>

Surely there's something else that you're not showing there. For some 
reason you got a list of segments in the error, and we haven't had that 
for a very long time. Do you have an onrequest hook or middleware that 
does weird things perhaps?

On 08/04/2014 06:39 PM, Samir Sow wrote:
> Hi,
>
> I?ve moved a working http server to https.
> SSL handshaking is ok but i got the following Ranch error :
>
> [error] Ranch listener https_mta had connection process started with cowboy_protocol:start_link/4 at <0.601.0> exit with reason: {badarg,[{binary,match,[[<<"com">>,<<"oockit">>,<<"www">>],<<".">>],[]},{cowboy_router,split_host,2,[{file,"src/cowboy_router.erl"},{line,305}]},{cowboy_router,match,3,[{file,"src/cowboy_router.erl"},{line,240}]},{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,169}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]}
>
> call is
>
> curl --cacert priv/cert/root.crt "https://www.oockit.com:7171/mtagw?
>
>
> dispatch is
>
> [{'_', [
>          {["/static/[...]"], cowboy_static, [{directory, {priv_dir, ?APP, [<<"static">>]}},
>          {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
> 	{"/mtagw", hck_mta, []}
>      ]}]).
>
>
> Any clue ?
>
> Thanks
>
> sincerely
>
> Samir
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>

-- 
Lo?c Hoguin
http://ninenines.eu

From samset at wanadoo.fr  Mon Aug  4 19:50:36 2014
From: samset at wanadoo.fr (Samir Sow)
Date: Mon, 4 Aug 2014 19:50:36 +0200
Subject: [99s-extend] ranch dispatch error ver 1.0.0
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>

I?m not sure i understand your question.

I?ve only started a cowboy https server with a handler.
The http version was working fine.

Sincerely

Samir

On 4 ao?t 2014, at 18:49, Lo?c Hoguin <essen at ninenines.eu> wrote:

> Surely there's something else that you're not showing there. For some reason you got a list of segments in the error, and we haven't had that for a very long time. Do you have an onrequest hook or middleware that does weird things perhaps?
> 
> On 08/04/2014 06:39 PM, Samir Sow wrote:
>> Hi,
>> 
>> I?ve moved a working http server to https.
>> SSL handshaking is ok but i got the following Ranch error :
>> 
>> [error] Ranch listener https_mta had connection process started with cowboy_protocol:start_link/4 at <0.601.0> exit with reason: {badarg,[{binary,match,[[<<"com">>,<<"oockit">>,<<"www">>],<<".">>],[]},{cowboy_router,split_host,2,[{file,"src/cowboy_router.erl"},{line,305}]},{cowboy_router,match,3,[{file,"src/cowboy_router.erl"},{line,240}]},{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,169}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]}
>> 
>> call is
>> 
>> curl --cacert priv/cert/root.crt "https://www.oockit.com:7171/mtagw?
>> 
>> 
>> dispatch is
>> 
>> [{'_', [
>>         {["/static/[...]"], cowboy_static, [{directory, {priv_dir, ?APP, [<<"static">>]}},
>>         {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
>> 	{"/mtagw", hck_mta, []}
>>     ]}]).
>> 
>> 
>> Any clue ?
>> 
>> Thanks
>> 
>> sincerely
>> 
>> Samir
>> 
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> https://lists.ninenines.eu/listinfo/extend
>> 
> 
> -- 
> Lo?c Hoguin
> http://ninenines.eu


From essen at ninenines.eu  Mon Aug  4 19:59:57 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Mon, 04 Aug 2014 19:59:57 +0200
Subject: [99s-extend] ranch dispatch error ver 1.0.0
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>

I'm saying it can't be the only difference.

On 08/04/2014 07:50 PM, Samir Sow wrote:
> I?m not sure i understand your question.
>
> I?ve only started a cowboy https server with a handler.
> The http version was working fine.
>
> Sincerely
>
> Samir
>
> On 4 ao?t 2014, at 18:49, Lo?c Hoguin <essen at ninenines.eu> wrote:
>
>> Surely there's something else that you're not showing there. For some reason you got a list of segments in the error, and we haven't had that for a very long time. Do you have an onrequest hook or middleware that does weird things perhaps?
>>
>> On 08/04/2014 06:39 PM, Samir Sow wrote:
>>> Hi,
>>>
>>> I?ve moved a working http server to https.
>>> SSL handshaking is ok but i got the following Ranch error :
>>>
>>> [error] Ranch listener https_mta had connection process started with cowboy_protocol:start_link/4 at <0.601.0> exit with reason: {badarg,[{binary,match,[[<<"com">>,<<"oockit">>,<<"www">>],<<".">>],[]},{cowboy_router,split_host,2,[{file,"src/cowboy_router.erl"},{line,305}]},{cowboy_router,match,3,[{file,"src/cowboy_router.erl"},{line,240}]},{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,169}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]}
>>>
>>> call is
>>>
>>> curl --cacert priv/cert/root.crt "https://www.oockit.com:7171/mtagw?
>>>
>>>
>>> dispatch is
>>>
>>> [{'_', [
>>>          {["/static/[...]"], cowboy_static, [{directory, {priv_dir, ?APP, [<<"static">>]}},
>>>          {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
>>> 	{"/mtagw", hck_mta, []}
>>>      ]}]).
>>>
>>>
>>> Any clue ?
>>>
>>> Thanks
>>>
>>> sincerely
>>>
>>> Samir
>>>
>>> _______________________________________________
>>> Extend mailing list
>>> Extend at lists.ninenines.eu
>>> https://lists.ninenines.eu/listinfo/extend
>>>
>>
>> --
>> Lo?c Hoguin
>> http://ninenines.eu
>

-- 
Lo?c Hoguin
http://ninenines.eu

From samset at wanadoo.fr  Mon Aug  4 20:16:06 2014
From: samset at wanadoo.fr (Samir Sow)
Date: Mon, 4 Aug 2014 20:16:06 +0200
Subject: [99s-extend] ranch dispatch error ver 1.0.0
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>

I can assure you it?s the only one :)

Samir

On 4 ao?t 2014, at 19:59, Lo?c Hoguin <essen at ninenines.eu> wrote:

> I'm saying it can't be the only difference.
> 
> On 08/04/2014 07:50 PM, Samir Sow wrote:
>> I?m not sure i understand your question.
>> 
>> I?ve only started a cowboy https server with a handler.
>> The http version was working fine.
>> 
>> Sincerely
>> 
>> Samir
>> 
>> On 4 ao?t 2014, at 18:49, Lo?c Hoguin <essen at ninenines.eu> wrote:
>> 
>>> Surely there's something else that you're not showing there. For some reason you got a list of segments in the error, and we haven't had that for a very long time. Do you have an onrequest hook or middleware that does weird things perhaps?
>>> 
>>> On 08/04/2014 06:39 PM, Samir Sow wrote:
>>>> Hi,
>>>> 
>>>> I?ve moved a working http server to https.
>>>> SSL handshaking is ok but i got the following Ranch error :
>>>> 
>>>> [error] Ranch listener https_mta had connection process started with cowboy_protocol:start_link/4 at <0.601.0> exit with reason: {badarg,[{binary,match,[[<<"com">>,<<"oockit">>,<<"www">>],<<".">>],[]},{cowboy_router,split_host,2,[{file,"src/cowboy_router.erl"},{line,305}]},{cowboy_router,match,3,[{file,"src/cowboy_router.erl"},{line,240}]},{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,169}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]}
>>>> 
>>>> call is
>>>> 
>>>> curl --cacert priv/cert/root.crt "https://www.oockit.com:7171/mtagw?
>>>> 
>>>> 
>>>> dispatch is
>>>> 
>>>> [{'_', [
>>>>         {["/static/[...]"], cowboy_static, [{directory, {priv_dir, ?APP, [<<"static">>]}},
>>>>         {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
>>>> 	{"/mtagw", hck_mta, []}
>>>>     ]}]).
>>>> 
>>>> 
>>>> Any clue ?
>>>> 
>>>> Thanks
>>>> 
>>>> sincerely
>>>> 
>>>> Samir
>>>> 
>>>> _______________________________________________
>>>> Extend mailing list
>>>> Extend at lists.ninenines.eu
>>>> https://lists.ninenines.eu/listinfo/extend
>>>> 
>>> 
>>> --
>>> Lo?c Hoguin
>>> http://ninenines.eu
>> 
> 
> -- 
> Lo?c Hoguin
> http://ninenines.eu


From essen at ninenines.eu  Mon Aug  4 20:24:15 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Mon, 04 Aug 2014 20:24:15 +0200
Subject: [99s-extend] ranch dispatch error ver 1.0.0
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>

Well I don't have any idea then. Cowboy is tested with http and https, 
both with and without compression enabled. There's never been any 
difference of the kind, the only difference is timing related.

On 08/04/2014 08:16 PM, Samir Sow wrote:
> I can assure you it?s the only one :)
>
> Samir
>
> On 4 ao?t 2014, at 19:59, Lo?c Hoguin <essen at ninenines.eu> wrote:
>
>> I'm saying it can't be the only difference.
>>
>> On 08/04/2014 07:50 PM, Samir Sow wrote:
>>> I?m not sure i understand your question.
>>>
>>> I?ve only started a cowboy https server with a handler.
>>> The http version was working fine.
>>>
>>> Sincerely
>>>
>>> Samir
>>>
>>> On 4 ao?t 2014, at 18:49, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>
>>>> Surely there's something else that you're not showing there. For some reason you got a list of segments in the error, and we haven't had that for a very long time. Do you have an onrequest hook or middleware that does weird things perhaps?
>>>>
>>>> On 08/04/2014 06:39 PM, Samir Sow wrote:
>>>>> Hi,
>>>>>
>>>>> I?ve moved a working http server to https.
>>>>> SSL handshaking is ok but i got the following Ranch error :
>>>>>
>>>>> [error] Ranch listener https_mta had connection process started with cowboy_protocol:start_link/4 at <0.601.0> exit with reason: {badarg,[{binary,match,[[<<"com">>,<<"oockit">>,<<"www">>],<<".">>],[]},{cowboy_router,split_host,2,[{file,"src/cowboy_router.erl"},{line,305}]},{cowboy_router,match,3,[{file,"src/cowboy_router.erl"},{line,240}]},{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,169}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]}
>>>>>
>>>>> call is
>>>>>
>>>>> curl --cacert priv/cert/root.crt "https://www.oockit.com:7171/mtagw?
>>>>>
>>>>>
>>>>> dispatch is
>>>>>
>>>>> [{'_', [
>>>>>          {["/static/[...]"], cowboy_static, [{directory, {priv_dir, ?APP, [<<"static">>]}},
>>>>>          {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
>>>>> 	{"/mtagw", hck_mta, []}
>>>>>      ]}]).
>>>>>
>>>>>
>>>>> Any clue ?
>>>>>
>>>>> Thanks
>>>>>
>>>>> sincerely
>>>>>
>>>>> Samir
>>>>>
>>>>> _______________________________________________
>>>>> Extend mailing list
>>>>> Extend at lists.ninenines.eu
>>>>> https://lists.ninenines.eu/listinfo/extend
>>>>>
>>>>
>>>> --
>>>> Lo?c Hoguin
>>>> http://ninenines.eu
>>>
>>
>> --
>> Lo?c Hoguin
>> http://ninenines.eu
>

-- 
Lo?c Hoguin
http://ninenines.eu

From samset at wanadoo.fr  Mon Aug  4 20:25:25 2014
From: samset at wanadoo.fr (Samir Sow)
Date: Mon, 4 Aug 2014 20:25:25 +0200
Subject: [99s-extend] Fwd:  ranch dispatch error ver 1.0.0
References: <[email protected]>
Message-ID: <[email protected]>


I found my mistake.

I?ve a typo error - used a token instead of a function call in the dispatch object.
I apologize for the disturbance.

Thank you.

Sincerely

Samir

Begin forwarded message:

> From: Samir Sow <samset at wanadoo.fr>
> Subject: Re: [99s-extend] ranch dispatch error ver 1.0.0
> Date: 4 ao?t 2014 20:16:06 UTC+2
> To: Lo?c Hoguin <essen at ninenines.eu>
> Cc: extend at lists.ninenines.eu
> 
> I can assure you it?s the only one :)
> 
> Samir
> 
> On 4 ao?t 2014, at 19:59, Lo?c Hoguin <essen at ninenines.eu> wrote:
> 
>> I'm saying it can't be the only difference.
>> 
>> On 08/04/2014 07:50 PM, Samir Sow wrote:
>>> I?m not sure i understand your question.
>>> 
>>> I?ve only started a cowboy https server with a handler.
>>> The http version was working fine.
>>> 
>>> Sincerely
>>> 
>>> Samir
>>> 
>>> On 4 ao?t 2014, at 18:49, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>> 
>>>> Surely there's something else that you're not showing there. For some reason you got a list of segments in the error, and we haven't had that for a very long time. Do you have an onrequest hook or middleware that does weird things perhaps?
>>>> 
>>>> On 08/04/2014 06:39 PM, Samir Sow wrote:
>>>>> Hi,
>>>>> 
>>>>> I?ve moved a working http server to https.
>>>>> SSL handshaking is ok but i got the following Ranch error :
>>>>> 
>>>>> [error] Ranch listener https_mta had connection process started with cowboy_protocol:start_link/4 at <0.601.0> exit with reason: {badarg,[{binary,match,[[<<"com">>,<<"oockit">>,<<"www">>],<<".">>],[]},{cowboy_router,split_host,2,[{file,"src/cowboy_router.erl"},{line,305}]},{cowboy_router,match,3,[{file,"src/cowboy_router.erl"},{line,240}]},{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,169}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]}
>>>>> 
>>>>> call is
>>>>> 
>>>>> curl --cacert priv/cert/root.crt "https://www.oockit.com:7171/mtagw?
>>>>> 
>>>>> 
>>>>> dispatch is
>>>>> 
>>>>> [{'_', [
>>>>>        {["/static/[...]"], cowboy_static, [{directory, {priv_dir, ?APP, [<<"static">>]}},
>>>>>        {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]},
>>>>> 	{"/mtagw", hck_mta, []}
>>>>>    ]}]).
>>>>> 
>>>>> 
>>>>> Any clue ?
>>>>> 
>>>>> Thanks
>>>>> 
>>>>> sincerely
>>>>> 
>>>>> Samir
>>>>> 
>>>>> _______________________________________________
>>>>> Extend mailing list
>>>>> Extend at lists.ninenines.eu
>>>>> https://lists.ninenines.eu/listinfo/extend
>>>>> 
>>>> 
>>>> --
>>>> Lo?c Hoguin
>>>> http://ninenines.eu
>>> 
>> 
>> -- 
>> Lo?c Hoguin
>> http://ninenines.eu
> 


From paulo.ferraz.oliveira at gmail.com  Tue Aug  5 12:58:10 2014
From: paulo.ferraz.oliveira at gmail.com (Paulo F. Oliveira)
Date: Tue, 5 Aug 2014 11:58:10 +0100
Subject: [99s-extend] Broken links for REST flowcharts
Message-ID: <CA+dV7cSRzu0Mnz-JqzBnp2JqjVB=Cx5XswuBU-7BT7nZi9=1tQ@mail.gmail.com>

Hi.

The image links are broken for the REST flowcharts' guide, part of cowboy.

http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/rest_start.png
(for example)
should probably be
http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_start.png
according to the hierarchy here:
https://github.com/ninenines/ninenines.github.io/tree/master/docs/en/cowboy/1.0/guide

Thanks.

- Paulo F. Oliveira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140805/2c08b12c/attachment.html>

From essen at ninenines.eu  Tue Aug  5 13:19:12 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Tue, 05 Aug 2014 13:19:12 +0200
Subject: [99s-extend] Broken links for REST flowcharts
In-Reply-To: <CA+dV7cSRzu0Mnz-JqzBnp2JqjVB=Cx5XswuBU-7BT7nZi9=1tQ@mail.gmail.com>
References: <CA+dV7cSRzu0Mnz-JqzBnp2JqjVB=Cx5XswuBU-7BT7nZi9=1tQ@mail.gmail.com>
Message-ID: <[email protected]>

Fixed, thanks.

On 08/05/2014 12:58 PM, Paulo F. Oliveira wrote:
> Hi.
>
> The image links are broken for the REST flowcharts' guide, part of cowboy.
>
> http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/rest_start.png
> (for example)
> should probably be
> http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_start.png
> according to the hierarchy here:
> https://github.com/ninenines/ninenines.github.io/tree/master/docs/en/cowboy/1.0/guide
>
> Thanks.
>
> - Paulo F. Oliveira
>
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>

-- 
Lo?c Hoguin
http://ninenines.eu

From essen at ninenines.eu  Tue Aug  5 14:43:47 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Tue, 05 Aug 2014 14:43:47 +0200
Subject: [99s-extend] [ANN] Cowboy 1.0
Message-ID: <[email protected]>

Hello!

Cowboy 1.0 has been released.

Cowboy is a small and fast HTTP server for Erlang with support for 
Webmachine-like REST, Websocket and more.

   https://github.com/ninenines/cowboy

Cowboy is the work of more than 80 people. I would like to congratulate 
everyone for the great work done so far. Thank you!

Please see the CHANGELOG for details on what's changed.

   https://github.com/ninenines/cowboy/blob/master/CHANGELOG.md

This release marks the beginning of the 1.0.x branch which will contain 
backward compatible fixes. This branch will be maintained at least until 
Cowboy 2.0 gets released (longer if sponsors request it). It is highly 
recommended that you follow this branch if you were following master 
before, as master will receive backward incompatible changes starting 
tomorrow.

Cowboy is now fully documented. It has a user guide, a function 
reference manual, and a wealth of examples. You can also install man 
pages as explained in the README of the project.

   http://ninenines.eu/docs/en/cowboy/1.0/guide/
   http://ninenines.eu/docs/en/cowboy/1.0/manual/
   https://github.com/ninenines/cowboy/tree/master/examples

Following a discussion on the Erlang mailing lists the Getting Started 
chapter was reworked and greatly simplified, in parts due to the 
improvements made to erlang.mk. Feedback is of course always welcome.

   http://ninenines.eu/docs/en/cowboy/1.0/guide/getting_started/

Starting tomorrow the master branch will receive backward incompatible 
changes. Most of the planned changes are detailed in the ROADMAP. You 
are welcome to suggest additional changes.

   https://github.com/ninenines/cowboy/blob/master/ROADMAP.md

Cowboy 2.0 is planned to be released at around the same time Erlang/OTP 
18.0 comes out. There are no plans for a Cowboy 1.1 at this time, 
although that may change in the coming months if there is interest in 
new features.

Ranch also got upgraded to 1.0, although there was no changes from the 
previous release.

   https://github.com/ninenines/ranch

Thanks to everyone who made this project what it is today!

-- 
Lo?c Hoguin
http://ninenines.eu

From max.lapshin at gmail.com  Tue Aug  5 15:33:27 2014
From: max.lapshin at gmail.com (Max Lapshin)
Date: Tue, 5 Aug 2014 17:33:27 +0400
Subject: [99s-extend] [erlang-questions] [ANN] Cowboy 1.0
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <CAMxVRxAwOt8y83P7wSxhDiOVJe7OZn5AFqowRACBqCSCbf7Qhw@mail.gmail.com>

Loic, it is very cool!

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140805/a3d520b7/attachment.html>

From gumm at sigma-star.com  Tue Aug  5 17:56:25 2014
From: gumm at sigma-star.com (Jesse Gumm)
Date: Tue, 5 Aug 2014 10:56:25 -0500
Subject: [99s-extend] [erlang-questions] [ANN] Cowboy 1.0
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <CAPTXyXcOJic72bbd8VCANqGoJNRZ44-HOQgm=mwa-=jcUDnt4Q@mail.gmail.com>

Congrats Loic!

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm
On Aug 5, 2014 7:43 AM, "Lo?c Hoguin" <essen at ninenines.eu> wrote:

> Hello!
>
> Cowboy 1.0 has been released.
>
> Cowboy is a small and fast HTTP server for Erlang with support for
> Webmachine-like REST, Websocket and more.
>
>   https://github.com/ninenines/cowboy
>
> Cowboy is the work of more than 80 people. I would like to congratulate
> everyone for the great work done so far. Thank you!
>
> Please see the CHANGELOG for details on what's changed.
>
>   https://github.com/ninenines/cowboy/blob/master/CHANGELOG.md
>
> This release marks the beginning of the 1.0.x branch which will contain
> backward compatible fixes. This branch will be maintained at least until
> Cowboy 2.0 gets released (longer if sponsors request it). It is highly
> recommended that you follow this branch if you were following master
> before, as master will receive backward incompatible changes starting
> tomorrow.
>
> Cowboy is now fully documented. It has a user guide, a function reference
> manual, and a wealth of examples. You can also install man pages as
> explained in the README of the project.
>
>   http://ninenines.eu/docs/en/cowboy/1.0/guide/
>   http://ninenines.eu/docs/en/cowboy/1.0/manual/
>   https://github.com/ninenines/cowboy/tree/master/examples
>
> Following a discussion on the Erlang mailing lists the Getting Started
> chapter was reworked and greatly simplified, in parts due to the
> improvements made to erlang.mk. Feedback is of course always welcome.
>
>   http://ninenines.eu/docs/en/cowboy/1.0/guide/getting_started/
>
> Starting tomorrow the master branch will receive backward incompatible
> changes. Most of the planned changes are detailed in the ROADMAP. You are
> welcome to suggest additional changes.
>
>   https://github.com/ninenines/cowboy/blob/master/ROADMAP.md
>
> Cowboy 2.0 is planned to be released at around the same time Erlang/OTP
> 18.0 comes out. There are no plans for a Cowboy 1.1 at this time, although
> that may change in the coming months if there is interest in new features.
>
> Ranch also got upgraded to 1.0, although there was no changes from the
> previous release.
>
>   https://github.com/ninenines/ranch
>
> Thanks to everyone who made this project what it is today!
>
> --
> Lo?c Hoguin
> http://ninenines.eu
> _______________________________________________
> erlang-questions mailing list
> erlang-questions at erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140805/fb1bc75c/attachment.html>

From lloyd at writersglen.com  Tue Aug  5 19:34:33 2014
From: lloyd at writersglen.com (lloyd at writersglen.com)
Date: Tue, 5 Aug 2014 13:34:33 -0400 (EDT)
Subject: [99s-extend] [erlang-questions] [ANN] Cowboy 1.0
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>

Tip of the hat, Lo?c et. al.

Outstanding and much appreciated work.

Best to all,

Lloyd

-----Original Message-----
From: "Lo?c Hoguin" <essen at ninenines.eu>
Sent: Tuesday, August 5, 2014 8:43am
To: "Erlang" <erlang-questions at erlang.org>, Extend at lists.ninenines.eu
Subject: [erlang-questions] [ANN] Cowboy 1.0

Hello!

Cowboy 1.0 has been released.

Cowboy is a small and fast HTTP server for Erlang with support for 
Webmachine-like REST, Websocket and more.

   https://github.com/ninenines/cowboy

Cowboy is the work of more than 80 people. I would like to congratulate 
everyone for the great work done so far. Thank you!

Please see the CHANGELOG for details on what's changed.

   https://github.com/ninenines/cowboy/blob/master/CHANGELOG.md

This release marks the beginning of the 1.0.x branch which will contain 
backward compatible fixes. This branch will be maintained at least until 
Cowboy 2.0 gets released (longer if sponsors request it). It is highly 
recommended that you follow this branch if you were following master 
before, as master will receive backward incompatible changes starting 
tomorrow.

Cowboy is now fully documented. It has a user guide, a function 
reference manual, and a wealth of examples. You can also install man 
pages as explained in the README of the project.

   http://ninenines.eu/docs/en/cowboy/1.0/guide/
   http://ninenines.eu/docs/en/cowboy/1.0/manual/
   https://github.com/ninenines/cowboy/tree/master/examples

Following a discussion on the Erlang mailing lists the Getting Started 
chapter was reworked and greatly simplified, in parts due to the 
improvements made to erlang.mk. Feedback is of course always welcome.

   http://ninenines.eu/docs/en/cowboy/1.0/guide/getting_started/

Starting tomorrow the master branch will receive backward incompatible 
changes. Most of the planned changes are detailed in the ROADMAP. You 
are welcome to suggest additional changes.

   https://github.com/ninenines/cowboy/blob/master/ROADMAP.md

Cowboy 2.0 is planned to be released at around the same time Erlang/OTP 
18.0 comes out. There are no plans for a Cowboy 1.1 at this time, 
although that may change in the coming months if there is interest in 
new features.

Ranch also got upgraded to 1.0, although there was no changes from the 
previous release.

   https://github.com/ninenines/ranch

Thanks to everyone who made this project what it is today!

-- 
Lo?c Hoguin
http://ninenines.eu
_______________________________________________
erlang-questions mailing list
erlang-questions at erlang.org
http://erlang.org/mailman/listinfo/erlang-questions



From paulo.ferraz.oliveira at gmail.com  Tue Aug  5 22:33:17 2014
From: paulo.ferraz.oliveira at gmail.com (Paulo F. Oliveira)
Date: Tue, 5 Aug 2014 21:33:17 +0100
Subject: [99s-extend] [erlang-questions] [ANN] Cowboy 1.0
In-Reply-To: <CAMuJbHgMSNLnCuf5x2+Nx1zUFhHy3=0rTGtLNbLJ=FfDU=tjfQ@mail.gmail.com>
References: <[email protected]>
 <CAMxVRxAwOt8y83P7wSxhDiOVJe7OZn5AFqowRACBqCSCbf7Qhw@mail.gmail.com>
 <CAMuJbHgMSNLnCuf5x2+Nx1zUFhHy3=0rTGtLNbLJ=FfDU=tjfQ@mail.gmail.com>
Message-ID: <CA+dV7cRYs3nfweJjUYLh-cCuuxmFbngoFUdDjoYgYwkky3LFNQ@mail.gmail.com>

Hi, Federico.

Check this out for the "why" regarding your question:
https://github.com/ninenines/cowboy/issues/715

It's one of the reasons (I haven't detected others yet) stopping me from
moving to 1.0, unfortunately (I have some projects depending on these
status codes already), but as soon as I have some time and look at all the
_major_ differences between 0.9.0 and 1.0 I think I'll make the move. For
the time being, I have found no issues with the REST part of cowboy (the
one I use).

Thank you, Lo?c et all for the effort and for keeping it open source.

Regards.

- Paulo F. Oliveira


On 5 August 2014 15:18, Federico Carrone <federico.carrone at gmail.com> wrote:

> Congratulations Loic. I really love cowboy.
>
> I got only one question: Why did you change the reply with 400 instead of
> 422 in cowboy_rest for unprocessable entities?
>
> Regards,
> Federico.
>
>
>
> On Tue, Aug 5, 2014 at 10:33 AM, Max Lapshin <max.lapshin at gmail.com>
> wrote:
>
>> Loic, it is very cool!
>>
>> Thanks.
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions at erlang.org
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
>
> --
> http://federicocarrone.com/
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions at erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140805/f3705f7b/attachment.html>

From essen at ninenines.eu  Tue Aug  5 22:55:34 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Tue, 05 Aug 2014 22:55:34 +0200
Subject: [99s-extend] [erlang-questions] [ANN] Cowboy 1.0
In-Reply-To: <CA+dV7cRYs3nfweJjUYLh-cCuuxmFbngoFUdDjoYgYwkky3LFNQ@mail.gmail.com>
References: <[email protected]>
 <CAMxVRxAwOt8y83P7wSxhDiOVJe7OZn5AFqowRACBqCSCbf7Qhw@mail.gmail.com>
 <CAMuJbHgMSNLnCuf5x2+Nx1zUFhHy3=0rTGtLNbLJ=FfDU=tjfQ@mail.gmail.com>
 <CA+dV7cRYs3nfweJjUYLh-cCuuxmFbngoFUdDjoYgYwkky3LFNQ@mail.gmail.com>
Message-ID: <[email protected]>

You can easily send 422 and return halt instead of returning false if 
you need to keep that, it'll just be 2 lines instead of 1. :)

On 08/05/2014 10:33 PM, Paulo F. Oliveira wrote:
> Hi, Federico.
>
> Check this out for the "why" regarding your question:
> https://github.com/ninenines/cowboy/issues/715
>
> It's one of the reasons (I haven't detected others yet) stopping me from
> moving to 1.0, unfortunately (I have some projects depending on these
> status codes already), but as soon as I have some time and look at all
> the _major_ differences between 0.9.0 and 1.0 I think I'll make the
> move. For the time being, I have found no issues with the REST part of
> cowboy (the one I use).
>
> Thank you, Lo?c et all for the effort and for keeping it open source.
>
> Regards.
>
> - Paulo F. Oliveira
>
>
> On 5 August 2014 15:18, Federico Carrone <federico.carrone at gmail.com
> <mailto:federico.carrone at gmail.com>> wrote:
>
>     Congratulations Loic. I really love cowboy.
>
>     I got only one question: Why did you change the reply with 400
>     instead of 422 in cowboy_rest for unprocessable entities?
>
>     Regards,
>     Federico.
>
>
>
>     On Tue, Aug 5, 2014 at 10:33 AM, Max Lapshin <max.lapshin at gmail.com
>     <mailto:max.lapshin at gmail.com>> wrote:
>
>         Loic, it is very cool!
>
>         Thanks.
>
>         _______________________________________________
>         erlang-questions mailing list
>         erlang-questions at erlang.org <mailto:erlang-questions at erlang.org>
>         http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
>
>     --
>     http://federicocarrone.com/
>
>     _______________________________________________
>     erlang-questions mailing list
>     erlang-questions at erlang.org <mailto:erlang-questions at erlang.org>
>     http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>

-- 
Lo?c Hoguin
http://ninenines.eu

From paulo.ferraz.oliveira at gmail.com  Tue Aug  5 23:01:38 2014
From: paulo.ferraz.oliveira at gmail.com (Paulo F. Oliveira)
Date: Tue, 5 Aug 2014 22:01:38 +0100
Subject: [99s-extend] [erlang-questions] [ANN] Cowboy 1.0
In-Reply-To: <[email protected]>
References: <[email protected]>
 <CAMxVRxAwOt8y83P7wSxhDiOVJe7OZn5AFqowRACBqCSCbf7Qhw@mail.gmail.com>
 <CAMuJbHgMSNLnCuf5x2+Nx1zUFhHy3=0rTGtLNbLJ=FfDU=tjfQ@mail.gmail.com>
 <CA+dV7cRYs3nfweJjUYLh-cCuuxmFbngoFUdDjoYgYwkky3LFNQ@mail.gmail.com>
 <[email protected]>
Message-ID: <CA+dV7cRNHiuZcJzc+x3=eVuEsty3-8pE_2XqBOpVdg4MSch_AA@mail.gmail.com>

Yes, it should be _that_ easy for the 400 > 422 :D, but is that the only
important difference I should be aware of, then? I haven't written any real
tests, for the time being, to guarantee backward compatibility for
dependants...

In any case, I'm thinking about updating the dependencies in the future (I
own one of them and the other one is an internal project, for the time
being).

Thanks for the tip.

Cheers.

- Paulo F. Oliveira


On 5 August 2014 21:55, Lo?c Hoguin <essen at ninenines.eu> wrote:

> You can easily send 422 and return halt instead of returning false if you
> need to keep that, it'll just be 2 lines instead of 1. :)
>
> On 08/05/2014 10:33 PM, Paulo F. Oliveira wrote:
>
>> Hi, Federico.
>>
>> Check this out for the "why" regarding your question:
>> https://github.com/ninenines/cowboy/issues/715
>>
>> It's one of the reasons (I haven't detected others yet) stopping me from
>> moving to 1.0, unfortunately (I have some projects depending on these
>> status codes already), but as soon as I have some time and look at all
>> the _major_ differences between 0.9.0 and 1.0 I think I'll make the
>> move. For the time being, I have found no issues with the REST part of
>> cowboy (the one I use).
>>
>> Thank you, Lo?c et all for the effort and for keeping it open source.
>>
>> Regards.
>>
>> - Paulo F. Oliveira
>>
>>
>> On 5 August 2014 15:18, Federico Carrone <federico.carrone at gmail.com
>> <mailto:federico.carrone at gmail.com>> wrote:
>>
>>     Congratulations Loic. I really love cowboy.
>>
>>     I got only one question: Why did you change the reply with 400
>>     instead of 422 in cowboy_rest for unprocessable entities?
>>
>>     Regards,
>>     Federico.
>>
>>
>>
>>     On Tue, Aug 5, 2014 at 10:33 AM, Max Lapshin <max.lapshin at gmail.com
>>     <mailto:max.lapshin at gmail.com>> wrote:
>>
>>         Loic, it is very cool!
>>
>>         Thanks.
>>
>>         _______________________________________________
>>         erlang-questions mailing list
>>         erlang-questions at erlang.org <mailto:erlang-questions at erlang.org>
>>         http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>>
>>     --
>>     http://federicocarrone.com/
>>
>>     _______________________________________________
>>     erlang-questions mailing list
>>     erlang-questions at erlang.org <mailto:erlang-questions at erlang.org>
>>     http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>>
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> https://lists.ninenines.eu/listinfo/extend
>>
>>
> --
> Lo?c Hoguin
> http://ninenines.eu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140805/34528764/attachment.html>

From essen at ninenines.eu  Tue Aug  5 23:06:19 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Tue, 05 Aug 2014 23:06:19 +0200
Subject: [99s-extend] [erlang-questions] [ANN] Cowboy 1.0
In-Reply-To: <CA+dV7cRNHiuZcJzc+x3=eVuEsty3-8pE_2XqBOpVdg4MSch_AA@mail.gmail.com>
References: <[email protected]>	<CAMxVRxAwOt8y83P7wSxhDiOVJe7OZn5AFqowRACBqCSCbf7Qhw@mail.gmail.com>	<CAMuJbHgMSNLnCuf5x2+Nx1zUFhHy3=0rTGtLNbLJ=FfDU=tjfQ@mail.gmail.com>	<CA+dV7cRYs3nfweJjUYLh-cCuuxmFbngoFUdDjoYgYwkky3LFNQ@mail.gmail.com>	<[email protected]>
 <CA+dV7cRNHiuZcJzc+x3=eVuEsty3-8pE_2XqBOpVdg4MSch_AA@mail.gmail.com>
Message-ID: <[email protected]>

If you were already at the previous version (0.10) then that plus a 400 
instead of 500 when header parsing fails are pretty much the only changes.

There's some more if you were at 0.9, mostly the body reading interface 
changed to prevent annoying timeout issues.

On 08/05/2014 11:01 PM, Paulo F. Oliveira wrote:
> Yes, it should be _that_ easy for the 400 > 422 :D, but is that the only
> important difference I should be aware of, then? I haven't written any
> real tests, for the time being, to guarantee backward compatibility for
> dependants...
>
> In any case, I'm thinking about updating the dependencies in the future
> (I own one of them and the other one is an internal project, for the
> time being).
>
> Thanks for the tip.
>
> Cheers.
>
> - Paulo F. Oliveira
>
>
> On 5 August 2014 21:55, Lo?c Hoguin <essen at ninenines.eu
> <mailto:essen at ninenines.eu>> wrote:
>
>     You can easily send 422 and return halt instead of returning false
>     if you need to keep that, it'll just be 2 lines instead of 1. :)
>
>     On 08/05/2014 10:33 PM, Paulo F. Oliveira wrote:
>
>         Hi, Federico.
>
>         Check this out for the "why" regarding your question:
>         https://github.com/ninenines/__cowboy/issues/715
>         <https://github.com/ninenines/cowboy/issues/715>
>
>         It's one of the reasons (I haven't detected others yet) stopping
>         me from
>         moving to 1.0, unfortunately (I have some projects depending on
>         these
>         status codes already), but as soon as I have some time and look
>         at all
>         the _major_ differences between 0.9.0 and 1.0 I think I'll make the
>         move. For the time being, I have found no issues with the REST
>         part of
>         cowboy (the one I use).
>
>         Thank you, Lo?c et all for the effort and for keeping it open
>         source.
>
>         Regards.
>
>         - Paulo F. Oliveira
>
>
>         On 5 August 2014 15:18, Federico Carrone
>         <federico.carrone at gmail.com <mailto:federico.carrone at gmail.com>
>         <mailto:federico.carrone at __gmail.com
>         <mailto:federico.carrone at gmail.com>>> wrote:
>
>              Congratulations Loic. I really love cowboy.
>
>              I got only one question: Why did you change the reply with 400
>              instead of 422 in cowboy_rest for unprocessable entities?
>
>              Regards,
>              Federico.
>
>
>
>              On Tue, Aug 5, 2014 at 10:33 AM, Max Lapshin
>         <max.lapshin at gmail.com <mailto:max.lapshin at gmail.com>
>              <mailto:max.lapshin at gmail.com
>         <mailto:max.lapshin at gmail.com>>__> wrote:
>
>                  Loic, it is very cool!
>
>                  Thanks.
>
>                  _________________________________________________
>                  erlang-questions mailing list
>         erlang-questions at erlang.org <mailto:erlang-questions at erlang.org>
>         <mailto:erlang-questions at __erlang.org
>         <mailto:erlang-questions at erlang.org>>
>         http://erlang.org/mailman/__listinfo/erlang-questions
>         <http://erlang.org/mailman/listinfo/erlang-questions>
>
>
>
>
>              --
>         http://federicocarrone.com/
>
>              _________________________________________________
>              erlang-questions mailing list
>         erlang-questions at erlang.org <mailto:erlang-questions at erlang.org>
>         <mailto:erlang-questions at __erlang.org
>         <mailto:erlang-questions at erlang.org>>
>         http://erlang.org/mailman/__listinfo/erlang-questions
>         <http://erlang.org/mailman/listinfo/erlang-questions>
>
>
>
>
>         _________________________________________________
>         Extend mailing list
>         Extend at lists.ninenines.eu <mailto:Extend at lists.ninenines.eu>
>         https://lists.ninenines.eu/__listinfo/extend
>         <https://lists.ninenines.eu/listinfo/extend>
>
>
>     --
>     Lo?c Hoguin
>     http://ninenines.eu
>
>

-- 
Lo?c Hoguin
http://ninenines.eu

From michael.wittig at tullius-walden.com  Wed Aug 13 11:17:51 2014
From: michael.wittig at tullius-walden.com (Michael Wittig)
Date: Wed, 13 Aug 2014 11:17:51 +0200
Subject: [99s-extend] eunit suppoort in erlang.mk?
Message-ID: <CAAgJJDuQ4RLXMU7YB3CK6ZvE7RcOyGO1-Xwa4736r1HYyhDOmQ@mail.gmail.com>

hi,

is it possible to run eunit tests when executing make tests?
I have my tests directly in the modules (e.g. xyz_server)

Regards,

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140813/7903a29a/attachment.html>

From chaehb at gmail.com  Thu Aug 14 03:20:05 2014
From: chaehb at gmail.com (chaehb)
Date: Thu, 14 Aug 2014 10:20:05 +0900
Subject: [99s-extend] couldn't quit in Erlang 17.1
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>


On 2014. 7. 27., at ?? 6:25, Lo?c Hoguin <essen at ninenines.eu> wrote:

> Does it happen with ssl_hello_world?
> 
> On 07/26/2014 09:06 AM, chaehb wrote:
>> Hi, everybody.
>> 
>> After Erlang updated to 17.1,
>> when I run q(). command on erlang console, cowboy couldn't quitted but print series of messages..
>> 
>> (after ok signal printed)
>> 
>> ?...
>> =ERROR REPORT==== 26-Jul-2014::15:23:33 ===
>> Error in process <0.334.0> on node ?...my node name...' with exit value: {{case_clause,{error,closed}},[{ranch_acceptor,loop,3,[{file,"src/ranch_acceptor.erl"},{line,28}]}]}
>> ?.
>> 
>> Before erlang updated (in 17.0), application could be normally quitted exactly same codes and environments.
>> 
>> This is only appeared when I only use ssl(https).
>> But when use only http with same dispatch rules, cowboy normally quitted.
>> 

I?ve try to do more tests with ssl_hello_world in cowboy(v1.0)  and various Erlang/OTP versions.

If ErlangOTP < 17.0, http/https works fine.
If ErlangOTP >= 17.1(17.1.x,17.2 in github), http works fine but with https the same errors appeared.

*****
When I edited ranch_accepter.erl > line 40 
	{error, Reason} when Reason =/= closed -> 
	to
	{error, Reason} ->
,
https work and app was normally quitted.

When I printed, Reason == closed.


From lists at tuli.pe  Thu Aug 14 17:44:25 2014
From: lists at tuli.pe (Camille Troillard)
Date: Thu, 14 Aug 2014 17:44:25 +0200
Subject: [99s-extend] cowboy_rest and response headers
Message-ID: <[email protected]>

Hello,

I would like to set a Content-Range header in the response of a HEAD request.
Can I do that within the context of a cowboy_rest handler?
Ideally, I wish to let cowboy_rest reply and just specify this additional header.


Best,
Camille
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140814/64f862ef/attachment.html>

From essen at ninenines.eu  Thu Aug 14 17:50:09 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Thu, 14 Aug 2014 17:50:09 +0200
Subject: [99s-extend] cowboy_rest and response headers
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>

Use cowboy_req:set_resp_header and return the Req this function gives you.

On 08/14/2014 05:44 PM, Camille Troillard wrote:
> Hello,
>
> I would like to set a Content-Range header in the response of a HEAD
> request.
> Can I do that within the context of a cowboy_rest handler?
> Ideally, I wish to let cowboy_rest reply and just specify this
> additional header.
>
>
> Best,
> Camille
>
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>

-- 
Lo?c Hoguin
http://ninenines.eu

From stephane at wirtel.be  Sun Aug 24 01:58:12 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Sun, 24 Aug 2014 01:58:12 +0200
Subject: [99s-extend] How to use the PUT verb with Cowboy_Rest ?
Message-ID: <[email protected]>

Hi all,

1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I 
have a small crash.

Here is my code:

https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4

Could you tell me if I correctly use cowboy_rest for the PUT verb? I 
have seen is_conflict/2, but I don't know how to use it.

2. I would like to change the response code, but I get the error. Is it 
possible?

Thank you.

Regards,

Stephane

--
St?phane Wirtel - http://wirtel.be - @matrixise

From daniel.goertzen at gmail.com  Sun Aug 24 02:16:02 2014
From: daniel.goertzen at gmail.com (Daniel Goertzen)
Date: Sat, 23 Aug 2014 19:16:02 -0500
Subject: [99s-extend] How to use the PUT verb with Cowboy_Rest ?
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <CAJCf5RxAZR2jx3Bf-XmYMPYs-i4rk8-Ba4xYqMWv=AjM3P33SQ@mail.gmail.com>

You should implement the resource_exists() callback; this will let the rest
module pick a 200 vs 201.  If the db name was incorrect, I think you are
just supposed to return false from the put callback.  I can't remember the
http code for that case.

Regards,
Dan.


On Sat, Aug 23, 2014 at 6:58 PM, St?phane Wirtel <stephane at wirtel.be> wrote:

> Hi all,
>
> 1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I have
> a small crash.
>
> Here is my code:
>
> https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4
>
> Could you tell me if I correctly use cowboy_rest for the PUT verb? I have
> seen is_conflict/2, but I don't know how to use it.
>
> 2. I would like to change the response code, but I get the error. Is it
> possible?
>
> Thank you.
>
> Regards,
>
> Stephane
>
> --
> St?phane Wirtel - http://wirtel.be - @matrixise
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140823/51e1d345/attachment.html>

From stephane at wirtel.be  Sun Aug 24 02:22:22 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Sun, 24 Aug 2014 02:22:22 +0200
Subject: [99s-extend] How to use the PUT verb with Cowboy_Rest ?
In-Reply-To: <CAJCf5RxAZR2jx3Bf-XmYMPYs-i4rk8-Ba4xYqMWv=AjM3P33SQ@mail.gmail.com>
References: <[email protected]>
 <CAJCf5RxAZR2jx3Bf-XmYMPYs-i4rk8-Ba4xYqMWv=AjM3P33SQ@mail.gmail.com>
Message-ID: <[email protected]>

resource_exists is used by POST
is_conflict is used by PUT (from the code)
but in the case where my database already exists, I need to return 412 
and not 409.

and I know I don't respect the default value returned by Cowboy_rest.

On 24 Aug 2014, at 2:16, Daniel Goertzen wrote:

> You should implement the resource_exists() callback; this will let the 
> rest
> module pick a 200 vs 201.  If the db name was incorrect, I think you 
> are
> just supposed to return false from the put callback.  I can't remember 
> the
> http code for that case.
>
> Regards,
> Dan.
>
>
> On Sat, Aug 23, 2014 at 6:58 PM, St?phane Wirtel <stephane at wirtel.be> 
> wrote:
>
>> Hi all,
>>
>> 1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I 
>> have
>> a small crash.
>>
>> Here is my code:
>>
>> https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4
>>
>> Could you tell me if I correctly use cowboy_rest for the PUT verb? I 
>> have
>> seen is_conflict/2, but I don't know how to use it.
>>
>> 2. I would like to change the response code, but I get the error. Is 
>> it
>> possible?
>>
>> Thank you.
>>
>> Regards,
>>
>> Stephane
>>
>> --
>> St?phane Wirtel - http://wirtel.be - @matrixise
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> https://lists.ninenines.eu/listinfo/extend
>>


--
St?phane Wirtel - http://wirtel.be - @matrixise

From edgurgel at gmail.com  Sun Aug 24 02:25:54 2014
From: edgurgel at gmail.com (Eduardo Gurgel)
Date: Sun, 24 Aug 2014 12:25:54 +1200
Subject: [99s-extend] How to use the PUT verb with Cowboy_Rest ?
In-Reply-To: <[email protected]>
References: <[email protected]>
 <CAJCf5RxAZR2jx3Bf-XmYMPYs-i4rk8-Ba4xYqMWv=AjM3P33SQ@mail.gmail.com>
 <[email protected]>
Message-ID: <CAKAMJXhPm0vZdTrhW3Zg=zyowQzc0AczhptyTAVyX404pvc3XA@mail.gmail.com>

I think you can always halt the processing and do the reply by yourself:

{ok, Req2} = cowboy_req:reply(412, Req),
{halt, Req2, State}.


On Sun, Aug 24, 2014 at 12:22 PM, St?phane Wirtel <stephane at wirtel.be>
wrote:

> resource_exists is used by POST
> is_conflict is used by PUT (from the code)
> but in the case where my database already exists, I need to return 412 and
> not 409.
>
> and I know I don't respect the default value returned by Cowboy_rest.
>
>
> On 24 Aug 2014, at 2:16, Daniel Goertzen wrote:
>
>  You should implement the resource_exists() callback; this will let the
>> rest
>> module pick a 200 vs 201.  If the db name was incorrect, I think you are
>> just supposed to return false from the put callback.  I can't remember the
>> http code for that case.
>>
>> Regards,
>> Dan.
>>
>>
>> On Sat, Aug 23, 2014 at 6:58 PM, St?phane Wirtel <stephane at wirtel.be>
>> wrote:
>>
>>  Hi all,
>>>
>>> 1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I
>>> have
>>> a small crash.
>>>
>>> Here is my code:
>>>
>>> https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4
>>>
>>> Could you tell me if I correctly use cowboy_rest for the PUT verb? I have
>>> seen is_conflict/2, but I don't know how to use it.
>>>
>>> 2. I would like to change the response code, but I get the error. Is it
>>> possible?
>>>
>>> Thank you.
>>>
>>> Regards,
>>>
>>> Stephane
>>>
>>> --
>>> St?phane Wirtel - http://wirtel.be - @matrixise
>>> _______________________________________________
>>> Extend mailing list
>>> Extend at lists.ninenines.eu
>>> https://lists.ninenines.eu/listinfo/extend
>>>
>>>
>
> --
> St?phane Wirtel - http://wirtel.be - @matrixise
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>



-- 
Eduardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140824/89d3a7f6/attachment.html>

From stephane at wirtel.be  Sun Aug 24 02:52:58 2014
From: stephane at wirtel.be (Stephane Wirtel)
Date: Sun, 24 Aug 2014 02:52:58 +0200
Subject: [99s-extend] How to use the PUT verb with Cowboy_Rest ?
In-Reply-To: <CAKAMJXhPm0vZdTrhW3Zg=zyowQzc0AczhptyTAVyX404pvc3XA@mail.gmail.com>
References: <[email protected]>
 <CAJCf5RxAZR2jx3Bf-XmYMPYs-i4rk8-Ba4xYqMWv=AjM3P33SQ@mail.gmail.com>
 <[email protected]>
 <CAKAMJXhPm0vZdTrhW3Zg=zyowQzc0AczhptyTAVyX404pvc3XA@mail.gmail.com>
Message-ID: <[email protected]>

Ok I will try asap, thanks

> On 24 ao?t 2014, at 02:25 AM, Eduardo Gurgel <edgurgel at gmail.com> wrote:
> 
> I think you can always halt the processing and do the reply by yourself:
> 
> {ok, Req2} = cowboy_req:reply(412, Req),
> {halt, Req2, State}.
> 
> 
>> On Sun, Aug 24, 2014 at 12:22 PM, St?phane Wirtel <stephane at wirtel.be> wrote:
>> resource_exists is used by POST
>> is_conflict is used by PUT (from the code)
>> but in the case where my database already exists, I need to return 412 and not 409.
>> 
>> and I know I don't respect the default value returned by Cowboy_rest.
>> 
>> 
>> On 24 Aug 2014, at 2:16, Daniel Goertzen wrote:
>> 
>>> You should implement the resource_exists() callback; this will let the rest
>>> module pick a 200 vs 201.  If the db name was incorrect, I think you are
>>> just supposed to return false from the put callback.  I can't remember the
>>> http code for that case.
>>> 
>>> Regards,
>>> Dan.
>>> 
>>> 
>>> On Sat, Aug 23, 2014 at 6:58 PM, St?phane Wirtel <stephane at wirtel.be> wrote:
>>> 
>>>> Hi all,
>>>> 
>>>> 1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I have
>>>> a small crash.
>>>> 
>>>> Here is my code:
>>>> 
>>>> https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4
>>>> 
>>>> Could you tell me if I correctly use cowboy_rest for the PUT verb? I have
>>>> seen is_conflict/2, but I don't know how to use it.
>>>> 
>>>> 2. I would like to change the response code, but I get the error. Is it
>>>> possible?
>>>> 
>>>> Thank you.
>>>> 
>>>> Regards,
>>>> 
>>>> Stephane
>>>> 
>>>> --
>>>> St?phane Wirtel - http://wirtel.be - @matrixise
>>>> _______________________________________________
>>>> Extend mailing list
>>>> Extend at lists.ninenines.eu
>>>> https://lists.ninenines.eu/listinfo/extend
>> 
>> 
>> --
>> St?phane Wirtel - http://wirtel.be - @matrixise
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> https://lists.ninenines.eu/listinfo/extend
> 
> 
> 
> -- 
> Eduardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140824/f35e1e51/attachment.html>

From stephane at wirtel.be  Sun Aug 24 11:54:58 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Sun, 24 Aug 2014 11:54:58 +0200
Subject: [99s-extend] Full example of cowboy_rest?
Message-ID: <[email protected]>

Hi all,

Do you have a concrete example of cowboy_rest ? with POST, GET, HEAD, 
PUT and DELETE ?

POST will use resource_exists and allow_missing_post
PUT will use is_conflict
DELETE delete_resource, etc...

Currently, I started with the example with put_json and get_json and in 
the functions, I fetch the Method and I use the pattern matching with 
the Method, but I think it's not the right solution.

What are the best practices?

The examples in the repository of cowboy don't cover all the 
possibilities of a simple rest api with these verbs.

Thanks in advance,

Stephane

--
St?phane Wirtel - http://wirtel.be - @matrixise

From paulo.ferraz.oliveira at gmail.com  Tue Aug 26 01:11:44 2014
From: paulo.ferraz.oliveira at gmail.com (Paulo F. Oliveira)
Date: Tue, 26 Aug 2014 00:11:44 +0100
Subject: [99s-extend] Full example of cowboy_rest?
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <CA+dV7cQXP3wEq5bn=3qWQ2EKuR39WZsRHCS+4Q1wgvLgDucjng@mail.gmail.com>

Hello, St?phane.

On 24 August 2014 10:54, St?phane Wirtel <stephane at wirtel.be> wrote:
>
> Hi all,
>
> Do you have a concrete example of cowboy_rest ? with POST, GET, HEAD, PUT and DELETE ?

AFAIK, from the official examples, the correct answer is "no", there
is no "complete" example (does it even make sense to have one?).

On the other hand, I've been using Cowboy for a couple of months now,
and find these docs (REST flowcharts -
http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/) to be
very useful, and they might also help you. You should find the time to
read the complete REST guide/manual as a lot of useful information can
be found there and a very nice effort was put into not wasting words
and going straight to the point.

...

> What are the best practices?

For what specifically?

> The examples in the repository of cowboy don't cover all the possibilities of a simple rest api with these verbs.

That is a fact. I, for one, tend to have a _template_ source code file
from where I get the functions that I need (only not to have to write
2/3 lines of code every time), and that I "chain" looking at the
flowcharts. [I also have a lib for JSON parsing and validating, query
string validation, etc...] This might not always be very easy (to
"chain" it all together, but it shouldn't be that hard either"), but
my approach is usually "OK, so I want a route to have GET, PUT and
DELETE... what are the related methods that I'll most probably
require? resource_exists (serves all methods), is_conflict (serves
PUT), delete_resource (serves DELETE), delete_completed (serves
DELETE)" and then I think about replying with a body or not (in the
case of GET there will almost always be a body, in the case of PUT
your method call might result in a 204 and in the case of DELETE there
may or not be a body). I then code the methods, test the API, checking
that the codes I get make sense (404, 200, 409, 204, 202, ...
depending on the conditions I want set) and then slightly document
this for the users of the API (if the API is complicated and requires
a lot of documentation there might be something wrong with it). For
documentation purposes you can either go with a "[VERB] route
accepts...?..., serves...?..., and the result codes are...?..." simple
doc or something more elaborate like
https://helloreverb.com/developers/swagger.

Hope it helps.

- Paulo F. Oliveira

>
> Thanks in advance,
>
> Stephane
>
> --
> St?phane Wirtel - http://wirtel.be - @matrixise
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend

From stephane at wirtel.be  Tue Aug 26 23:59:50 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Tue, 26 Aug 2014 23:59:50 +0200
Subject: [99s-extend] cowboy_rest and delete_completed and response
Message-ID: <[email protected]>

Hi all,

I work with two content-types (json, msgpack).

In the DELETE verb, I need to return an object and in this case, I work 
on delete_resource/2 and delete_completed/2.
The problem is, how can I return a body in function of the content-type? 
because after delete_completed, there is a call to the 
cowboy_rest:has_resp_body function and I need to set the body of the 
response.

delete_completed(Req, State) ->
	Body = Json or MsgPack ?  <-- Which content ?

	Req2 = cowboy_req:set_resp_body(Body, Req),
	{true, Req2, State}.

Ok, but in this case, what's the reason of content_types_provided/2 and 
content_types_accepted/2 ?

Thank you,

Stephane


--
St?phane Wirtel - http://wirtel.be - @matrixise

From essen at ninenines.eu  Wed Aug 27 00:03:45 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Wed, 27 Aug 2014 01:03:45 +0300
Subject: [99s-extend] cowboy_rest and delete_completed and response
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>

Call cowboy_req:meta(media_type, Req) to retrieve it.

On 08/27/2014 12:59 AM, St?phane Wirtel wrote:
> Hi all,
>
> I work with two content-types (json, msgpack).
>
> In the DELETE verb, I need to return an object and in this case, I work
> on delete_resource/2 and delete_completed/2.
> The problem is, how can I return a body in function of the content-type?
> because after delete_completed, there is a call to the
> cowboy_rest:has_resp_body function and I need to set the body of the
> response.
>
> delete_completed(Req, State) ->
>      Body = Json or MsgPack ?  <-- Which content ?
>
>      Req2 = cowboy_req:set_resp_body(Body, Req),
>      {true, Req2, State}.
>
> Ok, but in this case, what's the reason of content_types_provided/2 and
> content_types_accepted/2 ?
>
> Thank you,
>
> Stephane
>
>
> --
> St?phane Wirtel - http://wirtel.be - @matrixise
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend

-- 
Lo?c Hoguin
http://ninenines.eu

From stephane at wirtel.be  Wed Aug 27 00:12:00 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Wed, 27 Aug 2014 00:12:00 +0200
Subject: [99s-extend] cowboy_rest and delete_completed and response
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>

What's the purpose of the callbacks in content_types_accepted and 
content_types_provided?

I prefer set the response in the State to the callbacks and they convert 
it to the right format.

Example:

delete_completed(Req, State) ->
	Response = [{<<"ok">>, <<"dbname">>}],
	{true, Req, State#state{response=Response}}.

get_json(Req, #{response=Response}=State) ->
	Body = jsx:encode(Response),
	{Body, Req, State}.

get_msgpack(Req, #{response=Response}=State) ->
	Body = msgpack:pack(Response, [{format, jsx}],
	{Body, Req, State}.



On 27 Aug 2014, at 0:03, Lo?c Hoguin wrote:

> Call cowboy_req:meta(media_type, Req) to retrieve it.
>
> On 08/27/2014 12:59 AM, St?phane Wirtel wrote:
>> Hi all,
>>
>> I work with two content-types (json, msgpack).
>>
>> In the DELETE verb, I need to return an object and in this case, I 
>> work
>> on delete_resource/2 and delete_completed/2.
>> The problem is, how can I return a body in function of the 
>> content-type?
>> because after delete_completed, there is a call to the
>> cowboy_rest:has_resp_body function and I need to set the body of the
>> response.
>>
>> delete_completed(Req, State) ->
>>   Body = Json or MsgPack ?  <-- Which content ?
>>
>>   Req2 = cowboy_req:set_resp_body(Body, Req),
>>   {true, Req2, State}.
>>
>> Ok, but in this case, what's the reason of content_types_provided/2 
>> and
>> content_types_accepted/2 ?
>>
>> Thank you,
>>
>> Stephane
>>
>>
>> --
>> St?phane Wirtel - http://wirtel.be - @matrixise
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> https://lists.ninenines.eu/listinfo/extend
>
> -- 
> Lo?c Hoguin
> http://ninenines.eu


--
St?phane Wirtel - http://wirtel.be - @matrixise

From stephane at wirtel.be  Wed Aug 27 11:29:46 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Wed, 27 Aug 2014 11:29:46 +0200
Subject: [99s-extend] I need your feedback about this cowboy_rest handler.
Message-ID: <[email protected]>

Hi all,

This night, I wrote an example because I wanted to show you my work.

I have one handler for the concept of collections (in this case, tasks).

In this handler, I want these following methods:

POST /:collection
GET /:collection
DELETE /:collection
PUT /:collection
HEAD /:collection

:collection is a string, example: /tasks1

HEAD /:collection (/tasks1)
StatusCode:
	* 200 ok
	* 404 not found

GET /:collection (/tasks1)
Gets information about the collection
StatusCode:
	* 200 ok
	* 404 not found

PUT /:collection (/tasks1)
Create a new collection of tasks
Status_Code:
	* 201 created
	Response: an object, in msgpack or json and I need to had a location 
header
	* 412 precondition failed, the collection name already exists
	Response: an object, in msgpack or json with the error (already exists)

POST /:collection (/tasks1)
Add a new item in the collection, a new task
StatusCode:
	* 201 created
	* 202 accepted
	* 404 not found (error in the collection name)
Response: need to add a location header and return an object in msgpack 
or json.

DELETE /:collection (/tasks1)
Delete all the tasks
Status_Code:
	* 200 ok.
	* 404 not found
In the case of 200, we need to return an object in msgpack or json.


I provided a code and If you can help me, because I think cowboy_rest is 
a good solution, but I also think I will have some problems with my 
service.

Examples:
* delete_completed, I need to write the serialisation in the 
delete_completed function and not with the help of the defined callbacks 
of content_types_provided.
* for PUT, I need to return a location header, should I add it in the 
is_conflict
function?
* for PUT, how I have a 201? I have read the rest_flowchart and I need 
to specify the location header ok, but where? in the is_conflict 
function?

So, do you have time to help me, because with this example, I can 
propose it to the cowboy repository.
https://github.com/matrixise/demo_rest/blob/master/src/collection_handler.erl

You can propose your PR, comments or remarks, but I would like to use 
cowboy_rest.

Regards,

Stephane

--
St?phane Wirtel - http://wirtel.be - @matrixise

From essen at ninenines.eu  Wed Aug 27 12:03:41 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Wed, 27 Aug 2014 13:03:41 +0300
Subject: [99s-extend] I need your feedback about this cowboy_rest
	handler.
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>

Hey,

On 08/27/2014 12:29 PM, St?phane Wirtel wrote:
> Hi all,
>
> This night, I wrote an example because I wanted to show you my work.
>
> I have one handler for the concept of collections (in this case, tasks).
>
> In this handler, I want these following methods:
>
> POST /:collection
> GET /:collection
> DELETE /:collection
> PUT /:collection
> HEAD /:collection
>
> :collection is a string, example: /tasks1
>
> HEAD /:collection (/tasks1)
> StatusCode:
>      * 200 ok
>      * 404 not found
>
> GET /:collection (/tasks1)
> Gets information about the collection
> StatusCode:
>      * 200 ok
>      * 404 not found
>
> PUT /:collection (/tasks1)
> Create a new collection of tasks
> Status_Code:
>      * 201 created
>      Response: an object, in msgpack or json and I need to had a
> location header
>      * 412 precondition failed, the collection name already exists
>      Response: an object, in msgpack or json with the error (already
> exists)
>
> POST /:collection (/tasks1)
> Add a new item in the collection, a new task
> StatusCode:
>      * 201 created
>      * 202 accepted
>      * 404 not found (error in the collection name)
> Response: need to add a location header and return an object in msgpack
> or json.
>
> DELETE /:collection (/tasks1)
> Delete all the tasks
> Status_Code:
>      * 200 ok.
>      * 404 not found
> In the case of 200, we need to return an object in msgpack or json.
>
>
> I provided a code and If you can help me, because I think cowboy_rest is
> a good solution, but I also think I will have some problems with my
> service.
>
> Examples:
> * delete_completed, I need to write the serialisation in the
> delete_completed function and not with the help of the defined callbacks
> of content_types_provided.

What's the problem? The callbacks you set in content_types_provided are 
there to provide the *resource*. If you set a body in response to the 
DELETE method you are not sending the resource but information about the 
result of the operation.

> * for PUT, I need to return a location header, should I add it in the
> is_conflict
> function?

I would say in the callback you set in content_types_accepted. But...

> * for PUT, how I have a 201? I have read the rest_flowchart and I need
> to specify the location header ok, but where? in the is_conflict function?

Why do you need a 201? If you PUT a collection to /:collection then this 
is already the location of the collection. I am not sure what you are 
trying to do there exactly?

> So, do you have time to help me, because with this example, I can
> propose it to the cowboy repository.
> https://github.com/matrixise/demo_rest/blob/master/src/collection_handler.erl
>
>
> You can propose your PR, comments or remarks, but I would like to use
> cowboy_rest.
>
> Regards,
>
> Stephane
>
> --
> St?phane Wirtel - http://wirtel.be - @matrixise
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend

-- 
Lo?c Hoguin
http://ninenines.eu

From stephane at wirtel.be  Wed Aug 27 12:35:33 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Wed, 27 Aug 2014 12:35:33 +0200
Subject: [99s-extend] I need your feedback about this cowboy_rest
	handler.
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>

On 27 Aug 2014, at 12:03, Lo?c Hoguin wrote:

> Hey,
>
> On 08/27/2014 12:29 PM, St?phane Wirtel wrote:
>> Hi all,
>>
>> This night, I wrote an example because I wanted to show you my work.
>>
>> I have one handler for the concept of collections (in this case, 
>> tasks).
>>
>> In this handler, I want these following methods:
>>
>> POST /:collection
>> GET /:collection
>> DELETE /:collection
>> PUT /:collection
>> HEAD /:collection
>>
>> :collection is a string, example: /tasks1
>>
>> HEAD /:collection (/tasks1)
>> StatusCode:
>>  * 200 ok
>>  * 404 not found
>>
>> GET /:collection (/tasks1)
>> Gets information about the collection
>> StatusCode:
>>  * 200 ok
>>  * 404 not found
>>
>> PUT /:collection (/tasks1)
>> Create a new collection of tasks
>> Status_Code:
>>  * 201 created
>>  Response: an object, in msgpack or json and I need to had a
>> location header
>>  * 412 precondition failed, the collection name already exists
>>  Response: an object, in msgpack or json with the error (already
>> exists)
>>
>> POST /:collection (/tasks1)
>> Add a new item in the collection, a new task
>> StatusCode:
>>  * 201 created
>>  * 202 accepted
>>  * 404 not found (error in the collection name)
>> Response: need to add a location header and return an object in 
>> msgpack
>> or json.
>>
>> DELETE /:collection (/tasks1)
>> Delete all the tasks
>> Status_Code:
>>  * 200 ok.
>>  * 404 not found
>> In the case of 200, we need to return an object in msgpack or json.
>>
>>
>> I provided a code and If you can help me, because I think cowboy_rest 
>> is
>> a good solution, but I also think I will have some problems with my
>> service.
>>
>> Examples:
>> * delete_completed, I need to write the serialisation in the
>> delete_completed function and not with the help of the defined 
>> callbacks
>> of content_types_provided.
>
> What's the problem? The callbacks you set in content_types_provided 
> are there to provide the *resource*. If you set a body in response to 
> the DELETE method you are not sending the resource but information 
> about the result of the operation.
Ok, in this case, I understand. thanks
>
>> * for PUT, I need to return a location header, should I add it in the
>> is_conflict
>> function?
>
> I would say in the callback you set in content_types_accepted. But...
Works fine in the is_conflict function.
>
>> * for PUT, how I have a 201? I have read the rest_flowchart and I 
>> need
>> to specify the location header ok, but where? in the is_conflict 
>> function?
>
> Why do you need a 201? If you PUT a collection to /:collection then 
> this is already the location of the collection. I am not sure what you 
> are trying to do there exactly?
In this case, the PUT method is used for the creation of the resource 
and not for the update. This is the reason of the 201 status code.

In the rest_flowchart graph for the PUT/POST methods, what is the node 
"new resource" ? Is it just the {true, Req, State} from the callback 
defined in the content_types_accepted?

PS: I retested and now, I have my 201 with PUT, just resource_exists has 
to return false and not true ;-)

Thanks

--
St?phane Wirtel - http://wirtel.be - @matrixise

From essen at ninenines.eu  Wed Aug 27 12:53:19 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Wed, 27 Aug 2014 13:53:19 +0300
Subject: [99s-extend] I need your feedback about this cowboy_rest
	handler.
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>

>>> * for PUT, how I have a 201? I have read the rest_flowchart and I need
>>> to specify the location header ok, but where? in the is_conflict
>>> function?
>>
>> Why do you need a 201? If you PUT a collection to /:collection then
>> this is already the location of the collection. I am not sure what you
>> are trying to do there exactly?
> In this case, the PUT method is used for the creation of the resource
> and not for the update. This is the reason of the 201 status code.
>
> In the rest_flowchart graph for the PUT/POST methods, what is the node
> "new resource" ? Is it just the {true, Req, State} from the callback
> defined in the content_types_accepted?
>
> PS: I retested and now, I have my 201 with PUT, just resource_exists has
> to return false and not true ;-)

My bad I was a little confusing in my previous answer. You are right, if 
the resource doesn't exist and PUT is used we get a 201 automatically. 
The location header must only be provided if the resource was created 
elsewhere.

-- 
Lo?c Hoguin
http://ninenines.eu

From stephane at wirtel.be  Wed Aug 27 15:26:11 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Wed, 27 Aug 2014 15:26:11 +0200
Subject: [99s-extend] I need your feedback about this cowboy_rest
	handler.
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
Message-ID: <[email protected]>

On 27 Aug 2014, at 12:53, Lo?c Hoguin wrote:

>>>> * for PUT, how I have a 201? I have read the rest_flowchart and I 
>>>> need
>>>> to specify the location header ok, but where? in the is_conflict
>>>> function?
>>>
>>> Why do you need a 201? If you PUT a collection to /:collection then
>>> this is already the location of the collection. I am not sure what 
>>> you
>>> are trying to do there exactly?
>> In this case, the PUT method is used for the creation of the resource
>> and not for the update. This is the reason of the 201 status code.
>>
>> In the rest_flowchart graph for the PUT/POST methods, what is the 
>> node
>> "new resource" ? Is it just the {true, Req, State} from the callback
>> defined in the content_types_accepted?
>>
>> PS: I retested and now, I have my 201 with PUT, just resource_exists 
>> has
>> to return false and not true ;-)
>
> My bad I was a little confusing in my previous answer. You are right, 
> if the resource doesn't exist and PUT is used we get a 201 
> automatically. The location header must only be provided if the 
> resource was created elsewhere.

Don't worry and thank you for your answers.

Stephane

--
St?phane Wirtel - http://wirtel.be - @matrixise

From a.brandon.clark at gmail.com  Wed Aug 27 21:06:25 2014
From: a.brandon.clark at gmail.com (Brandon Clark)
Date: Wed, 27 Aug 2014 12:06:25 -0700
Subject: [99s-extend] Which erlang.mk?
Message-ID: <CA+_xk0k0LEftN+Lmn-BaYpmxYaSYuaOq1Et=8cX_R5u3O_Kkng@mail.gmail.com>

Greetings!

I'm trying to resurrect one of my neglected ranch applications.  It uses
Common Test, erlang.mk, and relx all in the usual way.  When I run make
tests with all fresh dependencies, I get this:

Doing /home/brandon/src/my_proj/deps/ranch...

make[1]: *** No rule to make target `build-tests'.  Stop.

make: *** [build-deps-tests] Error 2


A diff of my erlang.mk and deps/ranch/erlang.mk shows they are dramatically
different.  Mine came from here just this morning:

https://raw.*github.com <http://github.com>*/extend/
erlang.mk/master/erlang.mk

Which one is the "right" one for creating new apps?


Thank you!

~BC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140827/91c1e017/attachment.html>

From essen at ninenines.eu  Wed Aug 27 23:26:26 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Thu, 28 Aug 2014 00:26:26 +0300
Subject: [99s-extend] Which erlang.mk?
In-Reply-To: <CA+_xk0k0LEftN+Lmn-BaYpmxYaSYuaOq1Et=8cX_R5u3O_Kkng@mail.gmail.com>
References: <CA+_xk0k0LEftN+Lmn-BaYpmxYaSYuaOq1Et=8cX_R5u3O_Kkng@mail.gmail.com>
Message-ID: <[email protected]>

The one you downloaded from github is the correct one. It's a new 
version compared to the older one. A few small things changed, 
including, in this case, that build-tests was renamed to something like 
ct-build-tests (please open it to make sure of the name).

The new version allows greater customization and has a better package 
index feature and other things, but breaking compatibility with older 
Makefiles. The new version is labeled 1 (beginning of erlang.mk file) 
while the older one has no such label.

On 08/27/2014 10:06 PM, Brandon Clark wrote:
> Greetings!
>
> I'm trying to resurrect one of my neglected ranch applications.  It uses
> Common Test, erlang.mk <http://erlang.mk>, and relx all in the usual
> way.  When I run make tests with all fresh dependencies, I get this:
>
> Doing /home/brandon/src/my_proj/deps/ranch...
>
> make[1]: *** No rule to make target `build-tests'.  Stop.
>
> make: *** [build-deps-tests] Error 2
>
>
> A diff of my erlang.mk <http://erlang.mk> and deps/ranch/erlang.mk
> <http://erlang.mk> shows they are dramatically different.  Mine came
> from here just this morning:
>
> https://raw._github.com
> <http://github.com>_/extend/erlang.mk/master/erlang.mk
> <http://erlang.mk/master/erlang.mk>
>
> Which one is the "right" one for creating new apps?
>
>
> Thank you!
>
> ~BC
>
>
>
>
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>

-- 
Lo?c Hoguin
http://ninenines.eu

From stephane at wirtel.be  Wed Aug 27 23:41:25 2014
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Wed, 27 Aug 2014 23:41:25 +0200
Subject: [99s-extend] cowboy_rest : PUT and resource_exists vs is_conflict ?
Message-ID: <[email protected]>

Hi all,

For the PUT method, the flow is 

resource_exists
if method == PUT then go to the is_conflict function.
In each function, we need to check if the resource already exists or not.

I think we check twice, is it normal?

Thank you,

Stephane

--
St?phane Wirtel - http://wirtel.be - @matrixise

From essen at ninenines.eu  Wed Aug 27 23:48:41 2014
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Thu, 28 Aug 2014 00:48:41 +0300
Subject: [99s-extend] cowboy_rest : PUT and resource_exists vs
 is_conflict ?
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>

For some callbacks you may need to check but only if you need to perform 
a different operation when it does/doesn't. For example if you write to 
files a PUT is the same operation either way, but if you write to an SQL 
DB you will want to do INSERT/UPDATE depending on that. Same goes for 
is_conflict and others, it depends.

So sometimes you need to keep that info around in the state and 
sometimes you don't.

On 08/28/2014 12:41 AM, St?phane Wirtel wrote:
> Hi all,
>
> For the PUT method, the flow is
>
> resource_exists
> if method == PUT then go to the is_conflict function.
> In each function, we need to check if the resource already exists or not.
>
> I think we check twice, is it normal?
>
> Thank you,
>
> Stephane
>
> --
> St?phane Wirtel - http://wirtel.be - @matrixise
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>

-- 
Lo?c Hoguin
http://ninenines.eu

From paulo.ferraz.oliveira at gmail.com  Sat Aug 30 00:15:56 2014
From: paulo.ferraz.oliveira at gmail.com (Paulo F. Oliveira)
Date: Fri, 29 Aug 2014 23:15:56 +0100
Subject: [99s-extend] I need your feedback about this cowboy_rest
	handler.
In-Reply-To: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
 <[email protected]>
Message-ID: <CA+dV7cRD-UszqUz9gv5KH4rtmW+gC6a7tEJYQco66i891+Tqbg@mail.gmail.com>

PUT _should_ (there is no police here though) be used to either create
a resource or completely update it (it's refered to as "upsert" by
some; in Redis, for example, a similar concept would be "set").
Partial modifications should be made using PATCH. POST is what is
commonly used to create a resource. According to
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 412 is used
when "[t]he precondition given in one or more of the request-header
fields evaluated to false when it was tested on the server." (also:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24).

- Paulo F. Oliveira

On 27 August 2014 14:26, St?phane Wirtel <stephane at wirtel.be> wrote:
> On 27 Aug 2014, at 12:53, Lo?c Hoguin wrote:
>
>>>>> * for PUT, how I have a 201? I have read the rest_flowchart and I need
>>>>> to specify the location header ok, but where? in the is_conflict
>>>>> function?
>>>>
>>>>
>>>> Why do you need a 201? If you PUT a collection to /:collection then
>>>> this is already the location of the collection. I am not sure what you
>>>> are trying to do there exactly?
>>>
>>> In this case, the PUT method is used for the creation of the resource
>>> and not for the update. This is the reason of the 201 status code.
>>>
>>> In the rest_flowchart graph for the PUT/POST methods, what is the node
>>> "new resource" ? Is it just the {true, Req, State} from the callback
>>> defined in the content_types_accepted?
>>>
>>> PS: I retested and now, I have my 201 with PUT, just resource_exists has
>>> to return false and not true ;-)
>>
>>
>> My bad I was a little confusing in my previous answer. You are right, if
>> the resource doesn't exist and PUT is used we get a 201 automatically. The
>> location header must only be provided if the resource was created elsewhere.
>
>
> Don't worry and thank you for your answers.
>
> Stephane
>
>
> --
> St?phane Wirtel - http://wirtel.be - @matrixise
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend